Pololu Micro dual serial motor controller Help
vla7
Posts: 79
I've been having alot of problems with this little motor controller.· The current problem is that when I try to run·a program, it wants to run it twice.· For example when I enter this simple to program that should turn on motor 1 for one second then turn on motor two for one second, it always does it twice.· Can someone please tell me what I'm doing wrong?
' {$STAMP BS2}
HIGH 14
LOW 15
HIGH 15
PAUSE 100
SEROUT 14,32,[noparse][[/noparse]$80,0,2,127]
PAUSE 1000
SEROUT 14,32,[noparse][[/noparse]$80,0,2,0]
PAUSE 1000
SEROUT 14,32,[noparse][[/noparse]$80,0,0,127]
PAUSE 1000
SEROUT 14,32,[noparse][[/noparse]$80,0,0,0]
PAUSE 1000
END
I'd appreciate any insight into using Pololu's micro dual serial motor controller.
' {$STAMP BS2}
HIGH 14
LOW 15
HIGH 15
PAUSE 100
SEROUT 14,32,[noparse][[/noparse]$80,0,2,127]
PAUSE 1000
SEROUT 14,32,[noparse][[/noparse]$80,0,2,0]
PAUSE 1000
SEROUT 14,32,[noparse][[/noparse]$80,0,0,127]
PAUSE 1000
SEROUT 14,32,[noparse][[/noparse]$80,0,0,0]
PAUSE 1000
END
I'd appreciate any insight into using Pololu's micro dual serial motor controller.
Comments
Your code should look something like this:
SPEED VAR Byte
RESET_DSMC CON 3
Counter VAR Word
DEBUG CLS
DEBUG "Reset Controller", CR
FOR counter= 2000 TO 4000 STEP 200
FREQOUT 7, counter/50, counter
NEXT
' Set Default Configuration for DSMC
SEROUT 4,32,[noparse][[/noparse]$80,2,2]
PAUSE 10
' Reset DSMC
LOW RESET_DSMC
PAUSE 10
HIGH RESET_DSMC
PAUSE 100
'Start of tests
DEBUG "Ramp Up Right Motor Forward", CR
FOR SPEED = 0 TO 127 STEP 5
SEROUT 4,32,[noparse][[/noparse]$80,0,0,SPEED]
PAUSE 50
NEXT
DEBUG "Ramp Down Right Motor Forward", CR
FOR SPEED = 127 TO 0 STEP 5
SEROUT 4,32,[noparse][[/noparse]$80,0,0,SPEED]
PAUSE 50
NEXT
PAUSE 1000
DEBUG "Ramp Up Right Motor Reverse", CR
FOR SPEED = 0 TO 127 STEP 5
SEROUT 4,32,[noparse][[/noparse]$80,0,1,SPEED]
PAUSE 50
NEXT
DEBUG "Ramp Down Right Motors Reverse", CR
FOR SPEED = 127 TO 0 STEP 5
SEROUT 4,32,[noparse][[/noparse]$80,0,1,SPEED]
PAUSE 50
NEXT
PAUSE 1000
DEBUG "Ramp Up Left Motor Forward", CR
FOR SPEED = 0 TO 127 STEP 5
SEROUT 4,32,[noparse][[/noparse]$80,0,2,SPEED]
PAUSE 50
NEXT
DEBUG "Ramp Down Left Motor Forward", CR
FOR SPEED = 127 TO 0 STEP 5
SEROUT 4,32,[noparse][[/noparse]$80,0,2,SPEED]
PAUSE 50
NEXT
PAUSE 1000
DEBUG "Ramp Up Left Motor Reverse", CR
FOR SPEED = 0 TO 127 STEP 5
SEROUT 4,32,[noparse][[/noparse]$80,0,3,SPEED]
PAUSE 50
NEXT
DEBUG "Ramp Down Left Motors Reverse", CR
FOR SPEED = 127 TO 0 STEP 5
SEROUT 4,32,[noparse][[/noparse]$80,0,3,SPEED]
PAUSE 50
NEXT
PAUSE 1000