Step 3DOWNLOAD THE CODE TO THE PICAXE
This is the picaxe code I wrote to use with the socbot. As the socbot has no download circuit you will need to program the picaxe on a proto board and then move the programmed chip to the socbot.
The code uses the infrain2 command to wait for one of 3 valid codes from the universal remote. Depending on which code is received, the picaxe will send a 100mS current pulse to one motor or both motors. If the button is held down the current pulse repeats until the button is released.
A copy of the picaxe bas file is included below for download.
MAIN: let dirs= %00010111
BEGIN: let pins= %00000000
infrain2
let b0 = infra
if b0= 16 then AHEAD ' CH+
if b0= 19 then LEFT ' VOL-
if b0= 18 then RIGHT ' VOL+
goto BEGIN
AHEAD: let pins= %00010111 ' Outputs 0,1,2,4 HIGH
pause 100
goto MAIN
LEFT: let pins= %0000011 ' Outputs 0,1 HIGH 2,4 LOW
pause 100
goto BEGIN
RIGHT: let pins= %00010100 ' Outputs 2,4 HIGH 0,2 LOW
pause 100
goto MAIN
.
Socbot.bas531 bytes| « Previous Step | Download PDFView All Steps | Next Step » |

















































MAIN: let dirs= %00010111
^
Error: Unknown symbol - dirs