|
Re: Automous Programming
We can't tell what the polarity of your motors are or how they are mounted and geared. But your first loop is doing the same as moving one joystick forward and the other backwards. The second loop moves them both backwards. It may seem odd that pushing the joystick forward is negative numbers, but that is the way that HID devices are defined, and that was the standard chosen for the joystick library.
So my prediction is that the robot increases the spin speed for eight seconds, then sets the motors to slow backward and increases speed backwards for eight seconds.
Another thing to think about is how the robot drives using the joystick. After four seconds, your loop will effectively have the joysticks maxed out. Does that match what your human driver would do? It seems like you may want to try a smaller increment so that you wind up at the same point as the human driver.
To clean up the code a bit in readability, you can right click on the outer case and Remove the case. You can also do that to the sequence structure. You can right click on the output tunnels on the first for loop and disable the auto-indexing.
Greg McKaskle
|