27404 Parallax Inc, 27404 Datasheet - Page 64

COMPETITION RING FOR SUMOBOT

27404

Manufacturer Part Number
27404
Description
COMPETITION RING FOR SUMOBOT
Manufacturer
Parallax Inc
Datasheet

Specifications of 27404

Accessory Type
Hobby and Education
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
SumoBot®
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
After declaring this
an output. The BASIC Stamp Editor examines each command with
argument and decides whether to send an output to the pin or store the input value sensed
by the pin. When used in the
FREQOUT
Example Program: TestLedSpeaker.bs2
' -----[ Title ]--------------------------------------------------------------
' Applied Robotics with the SumoBot - TestLedSpeaker.bs2
' Tests the LED and piezospeaker circuit connected to P5 by flashing
' the LED on/off 15 times, then playing a tone on the speaker.
' {$STAMP BS2}
' {$PBASIC 2.5}
' -----[ I/O Definitions ]---------------------------------------------------
LedSpeaker
' -----[ Variables ]----------------------------------------------------------
counter
' -----[ Initialization ]-----------------------------------------------------
DEBUG CLS, "LED flashing..."
' -----[ Main Routine ]-------------------------------------------------------
LedSpeaker PIN 5
Enter, save, and run TestLedSpeaker.bs2.
Verify that it makes the LED rapidly turn on/off several times.
The piezospeaker should then play a brief tone.
If either of the components do not behave as expected, check your circuit and
program for errors.
, the BASIC Stamp Editor treats the I/O pin as an output.
Remember Each time the LED changes state, the speaker will make a clicking noise, and
each time the speaker plays, the LED will turn on.
If the LED doesn't turn on, remember from What's a Microcontroller and Robotics with the
Boe-Bot that the LED is a 1-way current valve. The LED's shorter cathode lead should be
connected to Vss; otherwise current will not flow through it.
PIN
VAR
PIN
directive, the name
5
Byte
PIN
argument of commands like
LedSpeaker
' Target = BASIC Stamp 2
' Language = PBASIC 2.5
' LED/speaker connected to P5
' Loop counting variable
' Prompt to check LED
can be used as either an input or
HIGH
LedSpeaker
,
LOW
,
TOGGLE
as an
, or

Related parts for 27404