Pololu Micro Dual Serial Motor Controller...
ChaosNOrder
Posts: 2
I'm working with the bs2 with the pololu..(refer to sub.) and with the code im working with I'm getting poor performance. Its ramping up and down to quickly to see much of any movement. I'm using a tamiya(sp) gearbox and motor set from a bulldozer set. That's all i know as far as motor specs. Can anyone suggest how to get the motors to run continuously or until an interrupt from from ping.
' {$STAMP BS2}
' {$PBASIC 2.5}
speed VAR Byte
HIGH 2
LOW 1
HIGH 1
PAUSE 100
FOR speed = 0 TO 127
SEROUT 2,84,[noparse][[/noparse]$80,0,0,speed]
PAUSE 20
NEXT
FOR speed = 127 TO 0
SEROUT 2,84,[noparse][[/noparse]$80,0,0,speed]
PAUSE 20
NEXT
FOR speed = 0 TO 127
SEROUT 2,84,[noparse][[/noparse]$80,0,0,speed]
PAUSE 20
NEXT
FOR speed = 127 TO 0
SEROUT 2,84,[noparse][[/noparse]$80,0,1,speed]
PAUSE 20
NEXT
' {$STAMP BS2}
' {$PBASIC 2.5}
speed VAR Byte
HIGH 2
LOW 1
HIGH 1
PAUSE 100
FOR speed = 0 TO 127
SEROUT 2,84,[noparse][[/noparse]$80,0,0,speed]
PAUSE 20
NEXT
FOR speed = 127 TO 0
SEROUT 2,84,[noparse][[/noparse]$80,0,0,speed]
PAUSE 20
NEXT
FOR speed = 0 TO 127
SEROUT 2,84,[noparse][[/noparse]$80,0,0,speed]
PAUSE 20
NEXT
FOR speed = 127 TO 0
SEROUT 2,84,[noparse][[/noparse]$80,0,1,speed]
PAUSE 20
NEXT
Comments
Dave
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dave Andreae
Parallax Tech Support·
It looks like the syntax is correct;·However, you could increase the PAUSE to give more time between each SEROUT command. For example, instead of PAUSE 20 (1/50th a second) put PAUSE 500 for 1/2 second. That should give you more time to see the ramping operation. Another option is give the value for PAUSE to a variable and make the PAUSE changeable,·until you get the speed that works best.
If you want, you can also post the entire code (attachment manager)·and we can offer some suggestions ti incorporate the PING))) sensor.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Respectfully,
Joshua Donelson
www.parallax.com