|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Reading Joystick Values Help
I need to get the value off the X axis on Joystick(1) the value being 0-256
I need to put the value into a float(JoyStick1Value) How do I do this code please if you can Thanks |
|
#2
|
||||
|
||||
|
Re: Reading Joystick Values Help
Look in BaeUtilities.h the NormalizeToRange() function
|
|
#3
|
|||
|
|||
|
Re: Reading Joystick Values Help
#include "WPILib.h"
#include <Joystick.h> class RobotDemo : public SimpleRobot { RobotDrive MyRobot; Joystick RightStick; Joystick LeftStick; public: RobotDemo(void): MyRobot(1, 2), RightStick(1), LeftStick(2) { GetWatchdog().SetExpiration(100); } void Autonomous(void) { } void OperatorControl(void) { GetWatchdog().SetEnabled(true); while (IsOperatorControl()) { RightStick.GetX(); //this is what i need help with } } }; START_ROBOT_CLASS(RobotDemo); I know i use this but RightStick.GetX(); where do i put the float to get the value |
|
#4
|
||||
|
||||
|
Re: Reading Joystick Values Help
What are you trying to do with it?
|
|
#5
|
|||||
|
|||||
|
Re: Reading Joystick Values Help
Are you talking about doing smething like:
float variablename = stick.GetX();? I don't really undestand what you are specifically trying to do. |
|
#6
|
|||
|
|||
|
Re: Reading Joystick Values Help
I am sorry i figured it out
(float) = RightStick.GetX(); |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Joystick values (?) | beefy1 | Programming | 1 | 12-23-2008 11:26 AM |
| Joystick axis values in new controller | koreabell | Programming | 7 | 12-17-2008 11:39 AM |
| Joystick Output Values? | compwiz2008 | Programming | 5 | 01-17-2008 10:40 PM |
| Mixing Joystick Values for mecanum wheels | Leav | Programming | 10 | 01-15-2006 02:51 PM |
| Need Help reading PDF files | Tton | General Forum | 6 | 02-14-2003 05:43 PM |