Hi All,
I'm able to create a simple LED flashing pattern in the program. How could I utilize a switchbank to choose some predefined flashing patterns? I assume I have to utilize the If (Decision).
Thanks
EDIT: okay i figured it out by using a slide switch and using a component macro to read the value (0 or 1) of the chip to follow a certain decision. Is there a way though to be able to select more than 2 patterns?
Selectable LED Pattern
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Selectable LED Pattern
Hello,
The switch icon will let you select more then two outcomes from a variable's value. Simply use an input icon to read the value from the switches and then use the switch icon to decide what to do based on the value from the input.
The switch icon will let you select more then two outcomes from a variable's value. Simply use an input icon to read the value from the switches and then use the switch icon to decide what to do based on the value from the input.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 5
- Joined: Thu Oct 13, 2011 5:58 am
Re: Selectable LED Pattern
I can see from a single switch how to read if its a 0 or a 1 and to have an action for either case. With a switch bank im not sure how it works. Should each pin be hooked up to the same pin? Different Pins? If they are to different pins how do I read the value of the switch to a particular pin (since they are part of the same switchbank). It they are to the same pin, say i have two switches on, is that a readstate of 2?
-
- Posts: 5
- Joined: Thu Oct 13, 2011 5:58 am
Re: Selectable LED Pattern
Nevermind I figured it out. I just used the input of a switch pin to set a variable (int). And then could decide what to do