Shop OBEX P1 Docs P2 Docs Learn Events
IR sensor help with servos — Parallax Forums

IR sensor help with servos

EP7EP7 Posts: 4
edited 2008-07-04 04:34 in BASIC Stamp
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

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-04 04:34
    Download the "Robotics with the BoeBot" tutorial from the "Stamps in Class Downloads" web page.
    (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.
Sign In or Register to comment.