|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Victors Controlled By Joystick Buttons
*topic
Any help would be greatly appreciated |
|
#2
|
||||
|
||||
|
Re: Victors Controlled By Joystick Buttons
if you want the victor to go full forward when the button is held down, then you can do something like:
pwm05 == the pwm channel the victor is connected to p1_sw_trig == joystick button that activates victor if (p1_sw_trig) { pwm05 = 254; } else { pwm05 = 127; } The if statement executes faster than a multiply or some other way of mapping. You may also need to debounce the joystick button, but since you say you are connecting it to a victor and not a pneumatic of some kind it may not matter. |
|
#3
|
||||
|
||||
|
Re: Victors Controlled By Joystick Buttons
You can also, using Joel's code, change the 254 to something else smaller to change the speed of the item you are looking to control. Just keep in mind 127 is center less than is one direction, more than is the other direction.
ie Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Free programming help | Cuog | Programming | 24 | 24-01-2006 16:43 |
| Programming motors with joystick buttons | TMHStitans | Programming | 5 | 21-03-2005 21:07 |
| Victors controlled with joystick Buttons | JamesBrown | Programming | 2 | 18-02-2005 23:39 |
| Using the extra buttons on the joystick. | Code\\Pilot | Programming | 7 | 04-12-2004 19:30 |
| problem with joystick buttons (top left one) | Richomundo | Programming | 5 | 15-02-2004 17:16 |