EasyManua.ls Logo

Parallax Boe-Bot - Page 278

Parallax Boe-Bot
360 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Page 264 · Robotics with the Boe-Bot
Solutions
Q1. 38.5 kHz is the frequency of the harmonic. Its fundamental frequency = 65536 –
38500 = 27036 Hz. The signals are sent for 1 millisecond, and the IR LED must
be connected to I/O Pin 2.
Q2. The command which stores the detector's output in a variable. For example,
irDetectLeft = IN9.
Q3. A low signal means IR at 38.5 kHz was detected, thus, an object was detected.
A high signal means no IR at 38.5kHz was detected, so, no object.
Q4. Electrically speaking, for both red and infrared LEDs, a smaller resistor will
cause the LED to glow more brightly. A bigger resistor results in dimmer LEDs.
In terms of results, brighter IR LEDs make it possible to detect objects that are
farther away.
E1. Change the
IF…THEN to read:
IF (IN0 = 0) THEN
This will only monitor the right detector.
E2. The
pulseCount variable allows the Boe-Bot to have adjustable distance of
motion depending on the situation.
P1. The FastIrRoaming.bs2 program can be combined with a
DO…UNTIL loop that
does nothing until it detects an object. A sample solution is shown below.
' -----[ Title ]-------------------------------------------------------
' Robotics with the Boe-Bot - MotionActivatedBoeBot.bs2
' Boe-Bot starts roaming when hand is waved in front of IR detectors.
' {$STAMP BS2}
' {$PBASIC 2.5}
' -----[ Variables ]---------------------------------------------------
irDetectLeft VAR Bit ' Variable Declarations
irDetectRight VAR Bit
pulseLeft VAR Word
pulseRight VAR Word
' -----[ Initialization ]----------------------------------------------
DEBUG "Program Running!"
FREQOUT 4, 2000, 3000 ' Signal program
start/reset.

Table of Contents

Other manuals for Parallax Boe-Bot