Flowcode and switch inputs

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

Moderators: Benj, Mods

Post Reply
dvwagner
Flowcode V4 User
Posts: 8
Joined: Tue Mar 04, 2008 11:24 pm

Flowcode and switch inputs

Post by dvwagner »

I am new to Flowcode and was trying to figure out how to utilize many switch inputs without the program repeating the input with the switches closed. Some examples would be appreciated.

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Re: Flowcode and switch inputs

Post by Steve »

Hi,

I'm not 100% sure what you mean by this. Could you please explain in more detail what you are trying to do?

dvwagner
Flowcode V4 User
Posts: 8
Joined: Tue Mar 04, 2008 11:24 pm

Re: Flowcode and switch inputs

Post by dvwagner »

I have eight or more switch inputs. When I press a input switch everything is fine if the switch is pressed only momentarily, but if for some reason the switch gets stuck the program sees it as multiple switch presses by means of the program loop. I would like when the switches are pressed, no matter how long, it will represent only one press.

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Re: Flowcode and switch inputs

Post by Steve »

Ok, I understand.

You essentially need to wait until the switch has gone down and then gone up again to register a switch click. So, if the switch input has gone high you need to wait until it has gone low again.

Of course, there are issue with switch "bouncing" - I think this has been dealt with in other threads.

It may not be apropriate for your program to wait until the input has gone low, so you could create a counter that increments around the loop and only registers the button press once the counter has increased a number of times since it the button was initially pressed.

I hope this helps a little.

Post Reply