![Picaxe Versabot Скачать руководство пользователя страница 28](http://html1.mh-extra.com/html/picaxe/versabot/versabot_manual_1554876028.webp)
Main:
toggle
LeftLED
' Swap the state of Left LED
toggle
RightLED
' Swap the state of Right LED
gosub
GoForward
' Call "GoForward"
pause
200
' Pause for 200ms
if
LeftBumper = 1
then
BackwardTurnRight
' If right bumper sensor
' BackwardTurnRight
if
RightBumper = 1
then
BackwardTurnLeft
' If the right bumper sensor
' BackwardTurnLeft
if
PushButton = 1
then
StopRobot
' If Push Button is pressed
' StopRobot
goto
Main
' Loop around to Main
BackwardTurnRight:
gosub
StopMotors
' Call StopMotors
gosub
GoBackwards
' Call GoBackwards
gosub
TurnRight
' Call TurnRight
goto
Main
' Loop around to Main
BackwardTurnLeft:
gosub
StopMotors
' Call StopMotors
gosub
GoBackwards
' Call GoBackwards
gosub
TurnLeft
' Call TurnLeft
goto
Main
' Loop around to Main
GoForward:
serout
LeftMotor,T2400,("A",150)
' Drive motor Anticlockwise
serout
RightMotor,T2400,("C",150)
' Drive motor Clockwise
return
GoBackwards:
pause
50
serout
LeftMotor,T2400,("C",150)
' Drive motor Clockwise
serout
RightMotor,T2400,("A",150)
' Drive motor Anticlockwise
for
temp = 1
to
25
pause
7
if
PushButton = 1
then
StopRobot
' If Push Button is pressed
' StopRobot
next
gosub
StopMotors
pause
50
return
TurnRight:
serout
LeftMotor,T2400,("A",150)
' Drive motor Anticlockwise
serout
RightMotor,T2400,("A",150)
' Drive motor Anticlockwise
for
temp = 1
to
25
pause
15
if
PushButton = 1
then
StopRobot
' If Push Button is pressed
' StopRobot
next
gosub
StopMotors
pause
50
return
TurnLeft:
serout
LeftMotor,T2400,("C",150)
' Drive motor Clockwise
serout
RightMotor,T2400,("C",150)
' Drive motor Clockwise
Содержание Versabot
Страница 1: ...The Versabot Manual July 2009...
Страница 23: ...Step 03 Step 04 Step 05...
Страница 24: ...Step 06 Step 07 Step 08...
Страница 25: ...Step 09 Step 10 Step 11...
Страница 26: ...Step 12 Step 13...