problem with avr waituntil

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

Moderators: Benj, Mods

Post Reply
ikke
Posts: 13
Joined: Sat Dec 12, 2009 6:08 pm
Contact:

problem with avr waituntil

Post by ikke »

Hello,
I am trying to toggle an output with a simple pushbutton. For 1 input/output the switchmacro works, but for the second one it just passes the macro.Or is there a better solution?
Thanks.
Attachments
toggle.fcf_avr
(6.5 KiB) Downloaded 246 times

Sean
Valued Contributor
Valued Contributor
Posts: 548
Joined: Tue Jun 26, 2007 11:23 am
Has thanked: 6 times
Been thanked: 44 times
Contact:

Re: problem with avr waituntil

Post by Sean »

Hello Ikke,

The only problem with the program is the parameters being used in the WaitUntil macros.

The WhichSwitch(Byte) parameter refers to the position of the monitored switch within the port byte (0 to 7). This can be a calculated value to provide flexibility, but your program requires the constant values 0 and 1 in branches for the corresponding inputs.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: problem with avr waituntil

Post by medelec35 »

Don't know if this will help.
This is how I controlled o/p that is toggled each time i/p goes high. It does not wait for a switch to be pressed before carrying on, program is constantly looping so other functions can be performed. While switch is pressed, program doe not continue until switch is released, to avoid rapid nuisance toggling .
toggle.jpg
(78.67 KiB) Downloaded 930 times
Note: Using var = var XOR 0b00000001 will also toggle.
Martin

Post Reply