Counting Circuit!

Forum for problems or queries regarding other Flowcode Components. Eg LEDs, Switches, LCD, Gfx LCD etc

Moderators: Benj, Mods

Post Reply
wroenaldinho_lufc
Posts: 1
Joined: Mon Apr 20, 2009 10:50 am
Contact:

Counting Circuit!

Post by wroenaldinho_lufc »

Hi, i am making a snooker circuit board for a college project, i have never used flowcode in mylife infact never even heard of it until now.
i am wanting to make it so that the buttons count up from 1 to 7. therefore i will need 7 buttons!

The problem i have is that the buttons only count up in 1's on the LED's, where as i would like button 2 to add 2 and button 3 to add 3 etc etc. how would i do this!

At the moment all my switches are adding 1 at a time.

Thank You!

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: Counting Circuit!

Post by Benj »

Hello

You should be able to do the following.

Use an input icon to read the input pin connected to a switch into a variable.
Use a decision icon and put the variable name in as the parameter.

Under the Yes branch add a calculation icon that adds a value to your count variable eg 1, 2, 3 etc

Repeat for other switch pins.

Hope this helps.
Attachments
Flowcode1.fcf
(6 KiB) Downloaded 289 times

Post Reply