|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#2
|
|||||
|
|||||
|
Re: Default code question
The basic idea is that it takes the p1_x value and adds it to p1_y for one side of the robots motors and subtracts it from p1_y for the other set of motors.
This makes it so that a single joystick can provide control of a tank steered robot. The limit_mix function stops the values from going out of range of an ordinary PWM value of 0-254. Take for example if the y axis is 0 and you move the x axis. You will be adding and subtracting from zero so each set of motors PWM value will have the same magnitude away from neutral, 127, but in opposite directions so the robot will spin in place. If you move the y axis while the x axis is non zero the robot will begin to arc because the y axis is added directly to both sides of the robot evenly. I hope that helps. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 2007 IFI default code question | Japper | Programming | 4 | 01-22-2007 11:23 PM |
| problems using gyro/adc code with camera default code | tanstaafl | Programming | 7 | 01-22-2006 11:09 PM |
| Question about Solenoid and default code | waialua359 | Control System | 4 | 01-21-2006 06:21 PM |
| navigate and default code newbie question | alan koch | Programming | 2 | 02-17-2004 10:25 PM |
| Rookie Programmer has question about the default code | DanL | Programming | 3 | 01-26-2002 07:59 PM |