Is it possable to make a flip flop program?
Prettybird
Posts: 269
· Getting creative with my first bot. I have several·2 on,off channels on a parallax R/C controller board. I would like to use one as a program stop and start to control a·disable enable·for a roaming with ping. The Boe book says nothing of this. I am a newbee and know what can be done with software but not a programmer. Any ideas would be appreciatted. I like this room alot.
The more you learn, the more you find you don't know. It is neverenging. Confucous· 550 BC
The more you learn, the more you find you don't know. It is neverenging. Confucous· 550 BC
Comments
To implement a switch toggle look at the section in the BOE that goes over switches (The Whisker section)...
page 182 on the Roboticsv2_2.pdf
... only instead of whiskers you use a switch. To Toggle, or "Flip-Flop", when you detect a switch closure in your program you can do something like...
PSEUDO Code Example:
...In the rest of your program, you look to see what the state of ToggleSwitch is. If it's a "1" then run your program as usual, if it's a "0" SLEEP, and monitor the switch periodically.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.