Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   BoundaryException on Cypress Board (http://www.chiefdelphi.com/forums/showthread.php?t=113851)

Norfen 18-02-2013 09:55

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
when called by
Code:

DriverStation.getInstance().getEnhancedIO().getButton(7)
and we can't figure out why. Help?

Cel Skeggs 18-02-2013 15:22

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?

Norfen 19-02-2013 12:08

Re: BoundaryException on Cypress Board
 
Does this mean that we can only use six buttons? I swear we've used more in previous years.

Joe Ross 19-02-2013 12:16

Re: BoundaryException on Cypress Board
 
Quote:

Originally Posted by Norfen (Post 1236327)
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.

Norfen 19-02-2013 22:50

Re: BoundaryException on Cypress Board
 
Switching to getDigital() does it, thank you. I guess i got mixed up between EnhancedIO and Joystick.


All times are GMT -5. The time now is 10:08.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi