Shop OBEX P1 Docs P2 Docs Learn Events
IR for Boe-Bot — Parallax Forums

IR for Boe-Bot

Freqout_38kHzFreqout_38kHz Posts: 13
edited 2007-07-13 14:58 in General Discussion
help me to write source code (sxb) object detection using IR...

Post Edited (Freqout_38kHz) : 7/12/2007 12:49:48 PM GMT

Comments

  • Freqout_38kHzFreqout_38kHz Posts: 13
    edited 2007-07-12 12:45
    anybody can help me how to write code sxb for boe-bot object detection using IR....i'm using sx28...
  • BeanBean Posts: 8,129
    edited 2007-07-12 13:07
    I'm not sure what you want. The IR detectors simply output a "1" when they see IR light, and a "0" when they don't.
    If you are making a beam-break system, then when the output goes low an object has broken the beam.
    If you are making a reflective system, then when the output goes high an object is infront of the receiver.

    If you want code to generate the 38KHz, then use:

    IR_LED     PIN RA.0 OUTPUT ' Use whatever pin you want
     
    INTERRUPT 76000 ' 2x frequency wanted
      IR_LED = ~IR_LED
    RETURNINT
    

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never argue with an idiot.· They'll drag you down to their level then beat you with experience.
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.hittconsulting.com
    ·
  • JonnyMacJonnyMac Posts: 9,215
    edited 2007-07-13 14:58
    Here's a program that will modulate an IR LED (per Bean's suggestion) and runs two servos in the background as well -- this should get you started.
Sign In or Register to comment.