Download Print this page

Picaxe Versabot Manual page 27

Advertisement

4.3 Downloading the program to drive your bump robot
Once your bump robot is built:
1. Start the Programming Editor or AXEpad and open the file BumpRobot.bas from your
CD-ROM ( File/Open).
2. Save the program (File/Save As...) to a location on you hard drive.
3.
Connect the download cable to your motherboard.
4. Press the F5 key to download your program into the PICAXE on your Versabot
motherboard.
5. Disconnect the download cable and place your Versabot on the ground.
6.
Press the button on the Button Module to start your Bump Robot.
4.4 The Code
We have included the code here so that you can investigate the program used:
'**Variables**
symbol
'**PICAXE motherboard output pin definitions**
symbol
symbol
symbol
symbol
'**PICAXE motherboard input pin definitions**
symbol
Symbol
symbol
'**Outputs**
symbol
symbol
symbol
symbol
'**Inputs**
symbol
symbol
symbol
'Initialise Motor outputs
StartOfProgram:
high
high
pause
StopRobot:
gosub
low
low
pause
do
loop until
do
loop until
temp
= w0
P0
= B.0
P1
= B.1
P11
= C.3
P12
= C.4
IN6
= pinB.6
IN13
= pinC.5
IN15
= pinC.7
LeftLED
= P0
RightLED
= P12
RightMotor
= P11
LeftMotor
= P1
PushButton
= IN6
LeftBumper
= IN15
RightBumper
= IN13
RightMotor
LeftMotor
50
StopMotors
LeftLED
RightLED
250
PushButton = 0
PushButton = 1
' Call StopMotors
' Turn LeftLED off
' Turn RightLED off
' Pause for 250ms
' Ensure no button pushed
' Wait until button pushed

Advertisement

loading
Need help?

Need help?

Do you have a question about the Versabot and is the answer not in the manual?

Questions and answers