|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Joystick Programming
In the file where it shows the joystick controls, I have tried different arrangements so that one joystick will control all of the wheels, but the program lines that it had devoted to this in the file does not work.
I need it so that when lean the joystick left the right wheels go forward while the left go back and Vice-versa, can anybody give me a code that will do this. I have tried to make one myself, but they don't work. |
|
#2
|
|||
|
|||
|
Re: Joystick Programming
pwm01 = p1_y;
pwm02 = p2_y; pwm03 = p3_y; pwm04 = p4_y; pwm05 = p1_x; pwm06 = p2_x; pwm07 = p3_x; pwm08 = p4_x; 01 will be the right while 02 will be the left, how do I set that up so that one will reverse while the other goes forward (as described above)? |
|
#3
|
||||
|
||||
|
Re: Joystick Programming
copied from innovation first's 2006 default programming
Code:
pwm13 = pwm14 = Limit_Mix(2000 + p1_y + p1_x - 127); pwm15 = pwm16 = Limit_Mix(2000 + p1_y - p1_x + 127); Code:
//pwm01 = p1_y; //pwm02 = p2_y; pwm03 = p3_y; pwm04 = p4_y; pwm05 = p1_x; pwm06 = p2_x; pwm07 = p3_x; pwm08 = p4_x; pwm09 = p1_wheel; pwm10 = p2_wheel; pwm11 = p3_wheel; pwm12 = p4_wheel; -Mike |
|
#4
|
|||
|
|||
|
Re: Joystick Programming
If you are using the default code and want 1 joystick drive, make sure your right motors are in pwm13/pwm14 and that your left motors are in pwm15/pwm16.
|
|
#5
|
|||
|
|||
|
Re: Joystick Programming
One detail I forgot, the left motors are connected through one wire and the same with the right.
|
|
#6
|
|||
|
|||
|
Re: Joystick Programming
That's perfectly fine. You don't need to use both 13 and 14, or both 15 and 16. Just one or the other. 13 and 14 are exactly the same, as are 15 and 16.
|
|
#7
|
|||
|
|||
|
Re: Joystick Programming
We are using the second stick for the launcher, I am not quite sure how to set that up (two weeks experience with programming). We need it so that when the top button is pressed, the motor starts. (I think that would be aux)
pwm 04 Then when the stick is pressed forward it moves the other motor forward and when moved backwards it goes backwards. pwm 05 |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Programming - Getting Started | Mark McLeod | Programming | 80 | 16-04-2008 23:37 |
| Programming motors with joystick buttons | TMHStitans | Programming | 5 | 21-03-2005 21:07 |
| Joystick Button programming | Bharat Nain | Programming | 5 | 18-02-2005 11:48 |
| single joystick programming | Bill Bonsky | OCCRA | 2 | 04-10-2003 09:47 |
| Programming the second joystick in PBASIC | archiver | 2001 | 2 | 24-06-2002 00:25 |