Go to Post That little voice in your head is not Ari telling you to keep going. It is your guardian angel telling you to stop! - Al Skierkiewicz [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 29-01-2010, 20:17
coo coo is offline
Registered User
AKA: Christopher
FRC #0503 (Frog Force)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Novi
Posts: 3
coo is an unknown quantity at this point
EnhancedIO Exception Error

We are trying to read a potentiometer connected to our Cypress IO board using the enhancedIO class.

Here is our code so far:
Code:
package edu.wpi.first.wpilibj.templates;

import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.Encoder;
import edu.wpi.first.wpilibj.AnalogChannel;
import edu.wpi.first.wpilibj.DigitalInput;
import edu.wpi.first.wpilibj.DriverStationEnhancedIO;
import edu.wpi.first.wpilibj.DriverStation;
/**
 * The VM is configured to automatically run this class, and to call the
 * functions corresponding to each mode, as described in the IterativeRobot
 * documentation. If you change the name of this class or the package after
 * creating this project, you must also update the manifest file in the resource
 * directory.
 */
public class Team503Robot extends IterativeRobot {
    private RobotDrive drivetrain;
    private Joystick gamepad;
    private Encoder leftDriveEncoder;
    private Encoder rightDriveEncoder;
    private AnalogChannel potentiometer;
    private DigitalInput limitSwitch;
    DriverStationEnhancedIO dseio; 
    /**
     * This function is run when the robot is first started up and should be
     * used for any initialization code.
     */
    public void robotInit() {
    dseio = DriverStation.getInstance().getEnhancedIO();


    }

    /**
     * This function is called periodically during autonomous
     */
    public void autonomousPeriodic() {

    }

    /**
     * This function is called periodically during operator control
     */
    public void teleopPeriodic() {
        double slider = dseio.getAnalogIn(1);

    }

}
We get an "unreported exception edu.wpi.first.wpilibj.DriverStationEnhancedIO.Enha ncedIOException; must be caught or declared to be thrown" error from the "double slider = dseio.getAnalogIn(1); line. Any help would be appreciated.
Reply With Quote
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wait Exception? NinJA999 Java 3 15-01-2010 14:13
Exception in Timer.cpp Phazonmutant C/C++ 2 17-02-2009 09:27
Target Exception - Exception in Kernal Task Thxe C/C++ 3 10-02-2009 07:24
error - language-plug-in exception... RedOctober45 Programming 1 16-01-2008 15:54
Joystick Exception? Blair Frank Control System 3 09-02-2007 22:41


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

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