Error in coding process

I’ve been trying to code a controller (A Gigaware USB controller) to control motors with a single button, on a Gigaware controller it has buttons like a Xbox controller X, Y, B, etc. Instead of those buttons it’s 1 (left), 2 (down), 3 (right), and 4(up). I would like to have 4(up) be that button that controls the motors but when 4 is released the motors stop. When I deploy the code it only works with the left analog stick, which I don’t want. I don’t know if I typed this code out wrong or what.
I’m not sure how to post the code (do i send it in a file or how to do it exactly)

Post it on https://github.com

If you are using java:
Use the joystick class and call yourJoystick.getRawButton(button id). It will return if it is pressed down or not. you can use yourJoystick.getRawButtonReleased(button id) to detect if it is released or not

If that doesn’t help then post it and link it somewhere for somebody to give more specific help.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.