27403 Parallax Inc, 27403 Datasheet - Page 85

GUIDE APP ROBOTCS W/SUMOBOT V1.0

27403

Manufacturer Part Number
27403
Description
GUIDE APP ROBOTCS W/SUMOBOT V1.0
Manufacturer
Parallax Inc
Datasheet

Specifications of 27403

Accessory Type
Manual
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
SumoBot®
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
The IR receivers are active-low, meaning they send a low signal to signify the active
condition (IR signal detected). When your SumoBot is dealing with lots of sensors, the
programming and trouble shooting will all be easier if they are all active-high.
The problem is this:
Instead, we want
it is not. This problem is solved by placing the invert bits operator, a tilde (~), in front of
IrSenseLF
Now, if
irLF
irLF
Testing the IR Detectors
The next example program tests the IR object detectors for basic functionality. When the
IR object detectors connected to the X8 and X9 headers are pointed straight ahead, their
detection
TestFrontIrObjectDetectors.bs2, the Debug Terminal should display a 1 when an object is
detected, and a 0 when it's not. In the figure, the SumoBot has detected an opponent with
the right detector, but not with its left. In later activities, you will experiment with
navigation corrections to get the opponent centered and engaged head-on.
. Likewise, if
.
irLF = ~IrSenseLF
IrSenseLF
in the statement:
pattern
irLF
IrSenseLF
stores a 1, the ~ operator inverts this value to 0 before copying it to
irLF
to store the opposite, a 1 when an object is detected, and a 0 when
look
stores a 0 when an object is detected and a 1 when it is not.
roughly
stores a 0, the ~ operator inverts it to 1 before storing it in
like
Figure
3-3.
While
running

Related parts for 27403