28125 Parallax Inc, 28125 Datasheet - Page 124

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
' Robotics with the Boe-Bot - StartResetIndicator.bs2
' Test the piezospeaker circuit.
' {$STAMP BS2}
' {$PBASIC 2.5}
DEBUG CLS, "Beep!!!"
FREQOUT 4, 2000, 3000
DO
LOOP
How StartResetIndicator.bs2 Works
StartResetIndicator.bs2 starts by displaying the message “Beep!!!” Then, immediately
after printing the message, the
speaker for 2 s. Because the instructions are executed so rapidly by the BASIC Stamp, it
should seem as though the message is displayed at the same instant the piezospeaker
starts to play the tone.
When the tone is done, the program enters a
reset…” message over and over again. Each time the reset button on the Board of
Education is pressed or the power is disconnected and reconnected, the program starts
over again, with the "Beep!!!" message and the 3 kHz tone.
Your Turn - Adding StartResetIndicator.bs2 to a Different Program
The lines of code in the battery indicator program will be used at the beginning of every
example program from here onward. You could consider it part of the “initialization
routine” or “boot routine” for every Boe-Bot program.
DEBUG CR, "Waiting for reset…"
PAUSE 500
If you did not hear a tone, check your wiring and code for errors. Repeat until
you get an audible tone from your speaker.
If you did hear an audible tone, try simulating the brownout condition by
pressing and releasing the Reset button on your board.
piezospeaker makes a clearly audible tone after each reset.
Also try disconnecting and reconnecting your battery supply, and verify that this
results in the reset warning tone as well.
FREQOUT
command plays a 3 kHz tone on the piezoelectric
DO…LOOP
' Stamp directive.
' PBASIC directive.
' Display while speaker beeps.
' Signal program start/reset.
' DO...LOOP
' Display message
' every 0.5 seconds
' until hardware reset.
, displaying the same “Waiting for
Verify that the

Related parts for 28125