BoundaryException on Cypress Board

We use a cypress board for our co-driver, and it recently started throwing an exception whenever we try to access a certain switch, however it had worked before. We traced back through our changes and can’t seem to find the problem.

It throws

edu.wpi.first.wpilibj.util.BoundaryException: Value must be between 1.0 and 6.0, 7.0 given

when called by


and we can’t figure out why. Help?

According to the documentation for DriverStationEnhancedIO, the button index given to getButton must be in the range of 1 to 6. You are passing 7 to this function.
Are you sure that you mean to use button seven?

Does this mean that we can only use six buttons? I swear we’ve used more in previous years.

Are you sure that in the past you didn’t connect your own buttons to digital inputs, and use the getDigital() method to read them? There are 16 digital IOs that can be configured as inputs.

Switching to getDigital() does it, thank you. I guess i got mixed up between EnhancedIO and Joystick.