Go to Post When the world gives you lemons make lemonade serve it at your press conference to expand the program. - Koko Ed [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 18-02-2013, 09:55
Norfen Norfen is offline
Registered User
FRC #0302 (The Dragons)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2011
Location: Michigan
Posts: 6
Norfen is an unknown quantity at this point
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?
Reply With Quote
  #2   Spotlight this post!  
Unread 18-02-2013, 15:22
Cel Skeggs Cel Skeggs is offline
Robot Software Manager Alumnus
AKA: Previously known as Colby
FRC #1540 (The Flaming Chickens)
Team Role: Alumni
 
Join Date: Feb 2013
Rookie Year: 2009
Location: Portland, Oregon, USA
Posts: 107
Cel Skeggs is a glorious beacon of lightCel Skeggs is a glorious beacon of lightCel Skeggs is a glorious beacon of lightCel Skeggs is a glorious beacon of lightCel Skeggs is a glorious beacon of lightCel Skeggs is a glorious beacon of light
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?
Reply With Quote
  #3   Spotlight this post!  
Unread 19-02-2013, 12:08
Norfen Norfen is offline
Registered User
FRC #0302 (The Dragons)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2011
Location: Michigan
Posts: 6
Norfen is an unknown quantity at this point
Re: BoundaryException on Cypress Board

Does this mean that we can only use six buttons? I swear we've used more in previous years.
Reply With Quote
  #4   Spotlight this post!  
Unread 19-02-2013, 12:16
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,572
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: BoundaryException on Cypress Board

Quote:
Originally Posted by Norfen View Post
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.
Reply With Quote
  #5   Spotlight this post!  
Unread 19-02-2013, 22:50
Norfen Norfen is offline
Registered User
FRC #0302 (The Dragons)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2011
Location: Michigan
Posts: 6
Norfen is an unknown quantity at this point
Re: BoundaryException on Cypress Board

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


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 11:44.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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