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