Toggle led with button

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

Moderator: Benj

Post Reply
matt_lebe
Posts: 1
Joined: Tue Jan 14, 2020 5:29 pm
Contact:

Toggle led with button

Post by matt_lebe »

Hello,

In school we are learning the basics of flowcode.
the teacher gave us a challenge to make a program so when i press a button the light goes on and when i press it again it goes off.
I tried to program this for 3 hours but havent found a way yet to make it work.
Can anyone help me?

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: Toggle led with button

Post by Benj »

Hello,

As it's a class exercise I won't do the code for you but here is some psuedocode you might use to create the program.

Light Off

Loop Start

Wait for Switch to go High
Light On
Wait for Switch to go Low

Wait for Switch to go High
Light Off
Wait for Switch to go Low

Loop End

Post Reply