28125 Parallax Inc, 28125 Datasheet - Page 123

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
Programming the Start/Reset Indicator
The next example program tests the piezospeaker. It uses the
precisely timed high/low signals to a speaker. Here is the
Here’s an example of a
The
Duration
2000 ms or 2 seconds. The
this example, the high/low signals will make a 3000 hertz, or 3 kHz, tone.
Example Program: StartResetIndicator.bs2
This example program makes a beep at the beginning of the program, then it goes on to
run a program that sends
continue indefinitely because they are nested between
BASIC Stamp is interrupted while it is in the middle of its
start at the beginning again. When it starts over, it will beep again. You can simulate a
brownout condition by either pressing and releasing the Reset button on your board or
disconnecting and reconnecting your board’s battery supply.
Pin
FREQOUT Pin, Duration, Freq1 {,Freq2}
FREQOUT 4, 2000, 3000
Reconnect power to your board.
Enter, save, and run StartResetIndicator.bs2.
Verify that the piezospeaker made a clearly audible tone for two seconds before
the “Waiting for reset…” messages started to display in the Debug Terminal.
argument is 4, meaning that the high/low signals will be sent to I/O pin P4. The
Frequency can be measured in hertz (Hz). The hertz is a frequency measurement of how
many times per second something happens. One hertz is simply one time-per-second, and
it’s abbreviated 1 Hz. One kilohertz is one-thousand-times-per-second, and it’s abbreviated
1 kHz.
FREQOUT
of varying durations that make a piezospeaker’s vibration more closely resemble natural
vibrations of music strings.
argument, which is how long the high/low signals will last, is 2000, which is
digitally synthesizes tones. The
FREQOUT
DEBUG
Freq1
command that’s used in the next example program.
argument is the frequency of the high/low signals. In
messages every half second. These messages will
FREQOUT
DO
FREQOUT
and
command applies high/low pulses
DO…LOOP
FREQOUT
LOOP
command’s syntax:
. If the power to the
, the program will
command to send

Related parts for 28125