Dual serial motor controller kit AND micro serial motor controller:
Could someone please check my code. Basically what I am trying to do is turn two motors on full speed for a period. I am running the Tamiya Planetory gearbox. (2 3v motors.) I have tried both controllers. The motors run for a few seconds, then stop. Sometimes they stop but hum. I am using a basic stamp. Both controllers do get warm. I have also tried this with 12V motors.
’ {$STAMP BS2}
’ {$PBASIC 2.5}
MLFwd CON 5 'l forward’
MRFwd CON 7 'r forward’
MLRrv CON 4 'l reverse
MRRrv CON 6 'r reverse’
Sout CON 3 'serial line , pin 4 on Pololu motor controller
Reset CON 4 'reset line , pin 5 on Pololu motor controller
x VAR Word
’Reset_SMC:
HIGH SOut
DEBUG “reset”
GOSUB resetcontroller
’SEROUT Sout, 84, [$80,2,2] 'commented out.
Main:
DEBUG “accel"
FOR x= 1 TO 1000
GOSUB Forward
DEBUG DEC x,” - "
NEXT
DEBUG "end"
SEROUT SOut, 84, [$80, 0, MLFwd,0]
SEROUT SOut, 84, [$80, 0, MRFwd,0]
GOSUB resetcontroller
END
Accelerate:
SEROUT SOut, 84, [$80, 0, MLFwd,127]
SEROUT SOut, 84, [$80, 0, MRFwd,127]
PAUSE 20
RETURN
resetcontroller:
HIGH 14
LOW 15
PAUSE 1000
HIGH 15
PAUSE 1000
RETURN