|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
1 Joystick Drive
From the User Default Code, in the part of one joystick drive we used
only those two lines: Code:
pwm09 = pwm11 = Limit_Mix(2000 + p1_x + p1_y - 127); pwm10 = pwm12 = Limit_Mix(2000 + p1_x - p1_y + 127); And we want to know what the Limit_Mix function is doing? thanks... |
|
#2
|
|||||
|
|||||
|
Re: 1 Joystick Drive
Although i do not know what other code in the part you are talking about, I do know what LimitMax is doing.
As you can see, the number being entered into the function is well over 2000, while the maximum that can be put to the PWM is only 255. What Limit_Max is reduces the input number, and its output is limited to the 0,255 range valid for the PWMs... On my team, we just skipped this and made all numbers signed so we could just add 127 making the range from -127,127, to 0,255.. but I would not advise doing this without knowing what you are doing, you may miss something and mess up the entire code. |
|
#3
|
|||||
|
|||||
|
Re: 1 Joystick Drive
I spent most of last season fiiguring out a better way to map the one joystick to the wheel speeds. I was please with what we finally created.
I posted a thread on it last March: http://www.chiefdelphi.com/forums/sh...t=trentonDrivehttp://www.chiefdelphi.com/forums/sh...t=trentonDrive |
|
#4
|
|||
|
|||
|
Re: 1 Joystick Drive
Do yourself a favour and don't play with limit mix. In our first year (last year) we had no idea what we did, so we removed it in some variations of the code we made...
Some of the junior programmers ended up having the robot with the wrong code (limit mixed removed, among other things). The robot went crazy almost ran over a few people. Becareful ![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| trentonDrive.c: our joystick/wheel drive code | gnormhurst | Programming | 16 | 03-02-2005 14:40 |
| Changing 1 joystick code to 2 (rookie team) | Brawler006 | Programming | 5 | 20-02-2004 17:00 |
| question about one joystick drive programing | james700 | Programming | 13 | 29-01-2003 14:49 |
| 1 joystick drive | Rickertsen2 | Robotics Education and Curriculum | 9 | 20-12-2002 20:00 |
| switching joystick axis????? | team222badbrad | Technical Discussion | 9 | 16-01-2002 23:07 |