27404 Parallax Inc, 27404 Datasheet - Page 176

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
that state while
pbSesnse
State diagrams can be visual aids for describing the different states in certain programs
along with the conditions the programs use to transition from one state to the next. For
example, PushbuttonLed.bs2 can be thought of as the instructions to make the SumoBot a
state machine implementation of Figure 4-9.
Example Program: PushbuttonLed.bs2
' Applied Robotics with the SumoBot - PushbuttonLed.bs2
' Simple finite state machine example.
' {$STAMP BS2}
' {$PBASIC 2.5}
pbSense
LedSpeaker PIN 5
LOW LedSpeaker
DO
LOOP
IF pbSense = 1 THEN
ELSE
ENDIF
PAUSE 100
DEBUG HOME, "State = Blink LED"
TOGGLE LedSpeaker
DEBUG HOME, "State = Led off", CLREOL
LOW LedSpeaker
Enter, save, and run PushbuttonLed.bs2
Monitor the LED and Debug Terminal as you press and hold and then release the
pushbutton on the SumoBot's breadboard. Do you agree that this program really
does implement the state machine diagram in Figure 4-9? Is it the only way the
figure can be implemented?
= 0.
PIN 6
pbSense
= 1, and the other that transitions to
LED off
when

Related parts for 27404