Shop OBEX P1 Docs P2 Docs Learn Events
ServoPAL_IR_Roaming.bs2 --- code question — Parallax Forums

ServoPAL_IR_Roaming.bs2 --- code question

ryan.sessmanryan.sessman Posts: 12
edited 2009-07-11 21:14 in Robotics

Read both IR sensors. Put inverted values into position in Obstacle.

ReadIR:

FREQOUT IREmtR, 1, 38500 'Activate the right IR emitter.
Obstacle.BIT0 = ~IRDetR 'Read the right IR sensor (and invert).
FREQOUT IREmtL, 1, 38500 'Activate the left IR emitter.
Obstacle.BIT1 = ~IRdetL 'Read the left IR sensor (and invert).
RETURN




I don't understand why IRDetR and IRDetL needs to be inverted.

Comments

Sign In or Register to comment.