Page 1 of 1

Switches in the FlowCode

Posted: Thu Sep 06, 2007 12:28 am
by ksor
I have a switch (a toggle component) connected to PORT_A bit5.

Now I want to "FlowCode" and If the switch is CLOSED I want to do macroA and if not do macroB.

The DECISION-icon can only test on VARIABLES (not directly on PORT_A.5 !) and the switch component does NOT allow me to define a variable for CLOSED and OPEN !

How does this "peace of cake" work ? - I can't get it !

Posted: Thu Sep 06, 2007 10:01 am
by Benj
Hello

What you need is a hardware macro icon.

This can be used to read the state of the switch into a variable.

If you have only one switch in your switch component then the parameter for the hardware macro would be 0.

The returned value can be placed into a variable and then this can be used by the decision icon.

Posted: Thu Sep 06, 2007 10:22 am
by ksor
Just take the course :oops: and see what to do !
I've done that now - sorry !