28125 Parallax Inc, 28125 Datasheet - Page 206

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 - CirclingWithWhiskerInput.bs2
' Move in 1 yard circle, increase/decrease radius in response
' to whisker presses, one whisker increases, one decreases.
' {$STAMP BS2}
' {$PBASIC 2.5}
DEBUG "Program Running!"
' -----[ Variables/Initialization ]------------------------------------
pulseWidth
toneFreq
pulseWidth = 716
toneFreq = 4000
' -----[ Main Routine ]------------------------------------------------
DO
LOOP
PULSOUT 13, 850
PULSOUT 12, pulseWidth
PAUSE 20
IF (IN5
ELSEIF (IN7
ENDIF
IF (pulseWidth <= 845) THEN
ENDIF
IF (pulseWidth >= 655) THEN
ENDIF
pulseWidth = pulseWidth + 5
toneFreq = toneFreq + 100
FREQOUT 4, 100, toneFreq
pulseWidth = pulseWidth - 5
toneFreq = toneFreq - 100
FREQOUT 4, 100, toneFreq
= 0) THEN
VAR
VAR
= 0) THEN
Word
Word
' Stamp directive.
' PBASIC directive.
' Signal sent to servo
' Frequency of beeping tone
' Found in Ch4 to make 1y circle
' Beginning tone is 4 kHz
' Pulse servos in circular path
' 12 slower than 13 so it arcs
' Left whisker makes circle
' smaller, down to servo max
' pulseWidth of 850.
' Play tone as indicator.
' Right whisker makes circle
' larger, down to servo min
' pulseWidth of 650.
' Play tone as indicator.

Related parts for 28125