Quote:
Originally Posted by AGPapa
This is almost certainly the problem.
You only need to have one drive system, the default arcade drive code works fine for your application and did not need to be changed.
I've attached a photo if you don't want to download Chris's code.
|
The code is
the a problem. You are commanding the same motor to go forward and reverse at once, making it not move.
This is actually not a direct result of using two drive systems (they cannot fight each other, drive one only uses PWM 1 and drive two PWM 2). The problem is because you have configured the left and right motors on each drive to feed to the same PWM, and then inverted one of them.
So your code works like this (when you go forward).
-->Get joystick value (1)
-->Set leftmotor to inverted joystick value (-1)
-->Set rightmotor to noninverted joystick value (1)
-->Left motor is PWM 1, set PWM 1 to value of -1
-->Right motor is PWM 1, set PWM 1 to value of 1
Nothing ever happens because you make the motors go full forward and full backward as fast as the code can execute.
Use Chris's code, but modify it for 4 talons (or use y-cables)