IR sensor help with servos
EP7
Posts: 4
I have·a SSIR IR detector by steven swanson that are now discontinued. I have the code(listed below)·that came with the detector and it works fine!·I was just wondering how to incorporate simple servo movement with the code. Here's the code that·it came with. Can anyone give me any examples of some basic servo movement with "this"·code upon object detection?· I'm still learning the· BS2!·· thanks for any help,· · EP
'{$STAMP BS2}
'{$PBASIC 2.5}
····· counter········ VAR······· Word
DIR0 = 1
Holdbit VAR·· Bit
Start:
·· FREQOUT 0,1,38500
·· Holdbit = IN0
DEBUG 1, "sensor = ",DEC Holdbit, CR
GOTO Start
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
THANKS,····· EP
'{$STAMP BS2}
'{$PBASIC 2.5}
····· counter········ VAR······· Word
DIR0 = 1
Holdbit VAR·· Bit
Start:
·· FREQOUT 0,1,38500
·· Holdbit = IN0
DEBUG 1, "sensor = ",DEC Holdbit, CR
GOTO Start
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
THANKS,····· EP
Comments
(Go the the main Parallax web page & select the "Resources" tab, then select "Downloads").
It explains how servos work and how to control them using a Stamp. There are also some
programs for doing IR object detection and combining that with servo movement in that
tutorial and in the "IR Remote for the BoeBot robot" tutorial on the same page.