28125 Parallax Inc, 28125 Datasheet - Page 57

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
Example Program: TimedMessages.bs2
There are lots of different ways to use the
PAUSE
program should wait one second before it sends the “One second elapsed…” message and
another two seconds before it displays the “Three seconds elapsed . . . ” message.
' Robotics with the Boe-Bot - TimedMessages.bs2
' Show how the PAUSE command can be used to display messages at human speeds.
' {$STAMP BS2}
' {$PBASIC 2.5}
DEBUG "Start timer..."
PAUSE 1000
DEBUG CR, "One second elapsed..."
PAUSE 2000
DEBUG CR, "Three seconds elapsed..."
DEBUG CR, "Done."
END
Your Turn – Different Pause Durations
You can change the delay between messages by changing the
Duration
to delay between printing messages that tell you how much time has elapsed. The
If you have a Board of Education Rev C, move the 3-postion switch from
position-0 to position-1.
If you have a HomeWork Board, reconnect the 9 V battery to the battery clip.
Enter the program below into the BASIC Stamp Editor.
Save the program under the name “TimedMessages.bs2”.
Run the program, then watch for the delay between messages.
From here onward, the three instructions that came before this program will be
phrased like this:
Enter, save, and run TimedMessages.bs2.
arguments.
PAUSE
command. This example program uses
PAUSE
commands’

Related parts for 28125