Joystick Buttons Not Working

Hello, this is our first year in FRC and while we were making our command to start and stop our winch to climb the rope we ran into a problem. We are getting an error telling us that our code is not finding our button that we are using in port 0 which is where the joystick is plugged in.

Does anyone know what we are doing wrong or how to fix it?

Thanks.

For better support can you please post a zip file of your code?

Couldn’t figure out how to put ZIP file on Chief Delphi but it is all on this link in GitHub.https://github.com/robokomets/robot2017/tree/master/src/org/usfirst/frc/team6758/robot

Warning at org.usfirst.frc.team6758.robot.Robot.disabledPeriodic(Robot.java: 71): Joystick button 6 on port 0 not available, check if controller is plugged in

Our joystick is plugged in and will register on the driver’s station.

First step is to look in the USB tab in the driver station to verify that the joystick is connected and assigned to the correct port. If you have more than one joystick connected, use the trigger to identify which joystick is assigned to which port.

Nothing obvious in the code that looks like a problem. One comment though.

In OI.cpp, it’s more straightforward to say

		climbUp.whileHeld(new ClimbUp());

than

		climbUp.whenPressed(new ClimbUp());
		climbUp.whenReleased(new ClimbStop());

If you use whileHeld(), ClimbUp.Interrupted() gets called automatically when you release the button. Then you don’t need to bother with the ClimbStop() class.

Make sure in Driver Station that you go to the USB Devices Tab and make sure your Joystick in in the correct order. And if you are using more than one Joystick/Controller in Robot Builder the “Number” is equal to the “Port Number” you are using in Drivers Station.

Thank you all for the help! Luckily we now have it running and working great!