|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 Code:
edu.wpi.first.wpilibj.util.BoundaryException: Value must be between 1.0 and 6.0, 7.0 given Code:
DriverStation.getInstance().getEnhancedIO().getButton(7) |
|
#2
|
|||
|
|||
|
Re: BoundaryException on Cypress Board
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? |
|
#3
|
|||
|
|||
|
Re: BoundaryException on Cypress Board
Does this mean that we can only use six buttons? I swear we've used more in previous years.
|
|
#4
|
||||||
|
||||||
|
Re: BoundaryException on Cypress Board
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.
|
|
#5
|
|||
|
|||
|
Re: BoundaryException on Cypress Board
Switching to getDigital() does it, thank you. I guess i got mixed up between EnhancedIO and Joystick.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|