debug controlled relay (solved)
bs2-man
Posts: 23
I need help programming the bs2 so that when i·type "on" a small relay activates, and when i·type "off" it turns off. plz help me out!
Post Edited (bs2-man) : 2/3/2010 2:57:27 AM GMT
Post Edited (bs2-man) : 2/3/2010 2:57:27 AM GMT
Comments
something like \:
debugin command
if command = "on" pin 3 high
if command = "off" pin 3 low
This is not real code and will not run on the stamp but the idea is sound.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Just checking the latest posts and.....
WHOA! I somehow missed that command in the manual! Thank you for pointing that out. It will be very useful [noparse]:)[/noparse]
' {$STAMP BS2}
' {$PBASIC 2.5}
command VAR Word
DO
DEBUGIN command
IF command = "on" THEN
HIGH 15
ELSE
IF command = "off" THEN
LOW 15
Experiment #34 in the StampWorks book shows some additional ways to communicate between a Stamp and a PC. It also shows ways to get data from sensors and pass them to a PC.
StampWorks is a free download on the Parallax web page.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Truth is out there············___$WMc%___···························· BoogerWoods, FL. USA