|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#2
|
|||
|
|||
|
Re: joystick and relay programming plz help!
You can use the GetX method from the Joystick class to return a float of the joystick from -1.0 to 1.0:
If you lean over half way to the left (on the x axis) it turns the relay reverse. The opposite then for the right direction and then off for in the middle. Code:
if(thirdStick->GetX() < -0.5) // IF OVER HALF WAY LEANING TO THE LEFT
agitator->Set(Relay::kReverse);
else if(thirdStick->GetX() > 0.5) // OVER HALF WAY TO THE RIGHT
agitator->Set(Relay::kForward);
else // NEITHER/IN BETWEEN
agitator->Set(Relay::kOff);
Last edited by pheadxdll : 09-02-2009 at 12:13. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do I program a relay to turn on and off by pressing a button on the joystick? | eweathers | NI LabVIEW | 4 | 28-01-2009 22:34 |
| Joystick Button Programming in Labview Help Needed | domoarigato | NI LabVIEW | 11 | 28-01-2009 10:55 |
| Programming Joystick Buttons to toggle a motor on and off | programmr | C/C++ | 6 | 25-01-2009 17:47 |
| Programming Help- 2 Motor 2 joystick Drive System | OMAR_567 | Programming | 2 | 02-02-2008 14:08 |
| i need specs for motors and pumps in the kit from last years competition plz help | SCYTE16 | Motors | 3 | 18-11-2004 22:54 |