Log in

View Full Version : Possible Joystick Error?


kmodos
26-01-2015, 18:48
When I was creating an extension of Joystick, I noticed an interesting error. If the button is pressed and held, getRawButton() will return true initially, however it will soon switch to false after a seemingly random amount of time. Has anyone else experienced this?

TFleig78
26-01-2015, 20:28
We've never had that issue. I've had programs that rely on someone holding a joystick button and using getRawButton() for minutes at a time without it ever returning false. How were you displaying the value?

kmodos
26-01-2015, 20:56
We've never had that issue. I've had programs that rely on someone holding a joystick button and using getRawButton() for minutes at a time without it ever returning false. How were you displaying the value?

We were holding the button with print the value of getRawButton(). I'll try with another computer/usb port at our next meeting.

Arhowk
26-01-2015, 22:21
It's most likely a fault in the controller itself. I've never encountered a similar issue in my years of programming though this year I'm mainly wrapped up in driver controls (which has no buttons)

TimTheGreat
26-01-2015, 22:22
It is always useful to share your code through pastebin or something initially so if it IS code, we can look at it right away

Crossle86
15-03-2015, 19:48
I'm looking a new situation (for us) where the getrawbutton call works as one would expect on the trigger but not on the other buttons. If the trigger is held, the getrawbutton call returns true as long as the button is held. When press and hold any other button on the JS, the getrawbutton call is returning true, false, true, false, true, false etc until the button is released. The alternating of the true/false value happens quickly about once a second. This seems incorrect but I am trying to confirm if this is a problem or a JS button behavior that I am unfamiliar with. This happens on all 3 JS we use. Now using a TI LaunchPad device to connect actual push buttons to the DS (launchpad looks to the code just like a joystick) the buttons work as expected, getrawbutton returns true as long as the button is held.

otherguy
16-03-2015, 10:23
Does your joystick have a rapid fire feature enabled?
Do all buttons behave as you described, or just some?

Crossle86
16-03-2015, 11:08
I don't know about rapid fire but that is a good idea. I will check that today. Trigger works normally or at least as I expected. Getrawbutton returns true when trigger held. All other buttons appear to toggle the return from Getrawbutton while button is held.

fovea1959
16-03-2015, 12:55
if you use some form of joystick diagnostic program on the driver station, does that also show the 1second true/false/true/false?

Crossle86
16-03-2015, 16:51
Update: This is not a joystick problem. It is a very subtle code bug which has been found and killed. Thanks to all who replied.