Selectable LED Pattern

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
driftlogic
Posts: 5
Joined: Thu Oct 13, 2011 5:58 am
Contact:

Selectable LED Pattern

Post by driftlogic »

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?

User avatar
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

Post by Benj »

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.

driftlogic
Posts: 5
Joined: Thu Oct 13, 2011 5:58 am
Contact:

Re: Selectable LED Pattern

Post by driftlogic »

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?

driftlogic
Posts: 5
Joined: Thu Oct 13, 2011 5:58 am
Contact:

Re: Selectable LED Pattern

Post by driftlogic »

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

Post Reply