View Single Post
  #3   Spotlight this post!  
Unread 25-11-2012, 01:03
Skyehawk's Avatar
Skyehawk Skyehawk is online now
Nuts N' Bolts
AKA: Skye Leake
FRC #0876 (Thunder Robotics)
Team Role: Mentor
 
Join Date: Nov 2012
Rookie Year: 2011
Location: Northwood, ND
Posts: 240
Skyehawk is a name known to allSkyehawk is a name known to allSkyehawk is a name known to allSkyehawk is a name known to allSkyehawk is a name known to allSkyehawk is a name known to all
Re: Enhanced I/O through Cypress

I read that page. Interesting stuff, though a little hard to grasp at parts. The I/O was plugged in and getting readings from the button I had wired in.

This is my new code:
Code:
        try {
            if (Cypress.getButton(2)) {
                Feed.setDirection(Relay.Direction.kForward);
            } else if(Cypress.getButton(3)) {
                Feed.setDirection(Relay.Direction.kReverse);
            }
        } catch (EnhancedIOException ex) {
            ex.printStackTrace();
            Feed.set(Relay.Value.kOff);
        }
I have not tried this code yet so I will update the thread once I do test it. Is this what you were getting at? Also, do I need the "ex.printStackTrace();" line, I know it helps in debuging, but will the program run more efficently without it?

Last edited by Skyehawk : 25-11-2012 at 01:05. Reason: update
Reply With Quote