Hi guys,
I'm a newbie to flowcode, i'M currently using a switch array to solve the below switching behaviour- hopefully someone can suggest a more elegant solution, any hints would be welcome.
Problem = 5 push buttons that each toggle, with the 5th used as a reset.
controller behaviour =
7 buttons (B1 to B7) and 5 LEDs (L1 to L5).
B1 toggles L1 on/off
//
B5 toggles L5 on/off
B6 sends just sends hex
B7 sends just sends hex
B5 turns L1-4 off.
Regards,
Chris
Basic push button logic help
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Basic push button logic help
Hi Chris,
lets take this one step at a time.
First step is toggle.
The XOR is used for toggling and the & is used for masking.
For example:
Will only toggle port A bits 0 to 3.
Will only toggle port A bits 0 to 2 etc.
That should give you a good helping hand.
Martin
lets take this one step at a time.
First step is toggle.
The XOR is used for toggling and the & is used for masking.
For example:
Code: Select all
Output = Output XOR PortAInput & 15
Code: Select all
Output XOR PortAInput & 7
That should give you a good helping hand.
Martin
Martin