View Full Version : Reversing motors
railerobotics
16-01-2006, 18:25
We are using a tank type driving system. How do I make the motors on one side go in reverse.
devicenull
16-01-2006, 18:27
pwmX = 255 - pwmX
Put that at the end of your code. Or you can switch around the wires going to the speed controller.
railerobotics
16-01-2006, 18:32
It gives me a syntax error
Mr. Steve
16-01-2006, 18:35
You need to substitute the X for the number.
An easier way would be to just take the motor wires running to the Victor speed controllers and switch them, plugging the red where the black was, and the black where the red was.
Just make sure to do this for the wires going from the motor to the Victor, not from the Victor to the panel.
devicenull
16-01-2006, 18:35
by pwmX I mean pwm01.. 16 depending on which you are using.. Without seeing the actual code, I'm not sure why it would cause a syntax error.
railerobotics
16-01-2006, 18:36
Oops, I put the code in the wrong place.
Now it works
Thanks for your help.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.