122-27400 Parallax Inc, 122-27400 Datasheet - Page 41

MANUAL FOR SUMOBOT

122-27400

Manufacturer Part Number
122-27400
Description
MANUAL FOR SUMOBOT
Manufacturer
Parallax Inc
Datasheet

Specifications of 122-27400

Accessory Type
Manual
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
RStop
RRevSlow
RRevFast
' -----[ Variables ]-------------------------------------------------------
lLine
rLine
lineBits
lbLeft
lbRight
pulses
temp
' -----[ EEPROM Data ]-----------------------------------------------------
RunStatus
' -----[ Initialization ]--------------------------------------------------
Reset:
Start_Delay:
' -----[ Program Code ]----------------------------------------------------
Main:
Go_Fwd:
Spin_Left:
READ RunStatus, temp
temp = ~temp
WRITE RunStatus, temp
IF (temp > 0) THEN END
HIGH StartLED
PAUSE 5000
LOW StartLED
GOSUB Read_Line_Sensors
' sumo movement
BRANCH lineBits, [Go_Fwd, Spin_Left, Spin_Right, About_Face]
PULSOUT LMotor, LFwdFast
PULSOUT RMotor, RFwdFast
GOTO Main
FOR pulses = 1 TO 20
NEXT
PULSOUT LMotor, LRevFast
PULSOUT RMotor, RFwdFast
PAUSE 20
CON
CON
CON
VAR
VAR
VAR
VAR
VAR
VAR
VAR
DATA
1000
Word
Word
Nib
lineBits.BIT1
lineBits.BIT0
Byte
Byte
$00
750
800
Chapter 3: SumoBot Sensors and Border Detection · Page 31
' right motor stop
' right motor rev; slow
' right motor rev; fast
' left sensor raw reading
' right sensor raw reading
' decoded sensors value
' counter for motor control
' run status
' read current status
' invert status
' save for next reset
' run now?
' show active
' start delay
' LED off

Related parts for 122-27400