Switches in the FlowCode

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

Moderators: Benj, Mods

Post Reply
ksor
Posts: 126
Joined: Mon Oct 23, 2006 3:50 pm

Switches in the FlowCode

Post 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 !
Best regards
KSor, Denmark

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:

Post 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.

ksor
Posts: 126
Joined: Mon Oct 23, 2006 3:50 pm

Post by ksor »

Just take the course :oops: and see what to do !
I've done that now - sorry !
Best regards
KSor, Denmark

Post Reply