28125 Parallax Inc, 28125 Datasheet - Page 254

TEXT ROBOTICS

28125

Manufacturer Part Number
28125
Description
TEXT ROBOTICS
Manufacturer
Parallax Inc
Datasheet

Specifications of 28125

Title
Robotics with the Boe-Bot
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
The key to making each IR LED/detector pair work is to send 1 ms of 38.5 kHz
harmonic, and then, immediately store the IR detector’s output in a variable. Here is an
example that sends the 38.5 kHz signal to the IR LED connected to P8, then stores the IR
detector’s output, which is connected to P9, in a bit variable named
The IR detector’s output state when it sees no IR signal is high. When the IR detector
sees the 38500 Hz harmonic reflected by an object, its output is low. The IR detector’s
output only stays low for a fraction of a millisecond after the
sending the harmonic, so it’s essential to store the IR detector’s output in a variable
immediately after sending the
then be displayed in the Debug Terminal or used for navigation decisions by the Boe-Bot.
Example Program: TestLeftIrPair.bs2
' Robotics with the Boe-Bot - TestLeftIrPair.bs2
' Test IR object detection circuits, IR LED connected to P8 and detector
' connected to P9.
' {$STAMP BS2}
Reconnect power to your board.
Enter, save, and run TestLeftIrPair.bs2.
FREQOUT
The fundamental frequency is the value of the
32768. For example, when you use the command
fundamental frequency is 3000 Hz. That's the intended sound, but there is also a harmonic
sound that accompanies it. This harmonic is a much higher frequency that the human ear
can detect, in the neighborhood of 62.5 kHz.
frequency given the fundamental and visa versa.
Whenever you use the
hidden (harmonic) tone as well. The equation for the harmonic is:
Whenever you use the
a harmonic, it contains a fundamental tone. The equation for the fundamental is:
FREQOUT 8, 1, 38500
irDetectLeft = IN9
harmonic frequency = 65536 – Freq1,
fundamental frequency = 65536 – Freq1,
Command - Fundamentals and Harmonics
FREQOUT
FREQOUT
FREQOUT
command with a
command. The value stored by the variable can
command to send a tone in this range, it contains that
Freq1
Here's how to calculate the harmonic
Freq1
FREQOUT 4, 2000, 3000
Freq1 <= 32678
Freq1 > 32768
argument when it’s at or below
argument above 32768 to send
FREQOUT
irDetectLeft
command is done
FREQOUT
.
, the

Related parts for 28125