View Single Post
  #3   Spotlight this post!  
Unread 05-02-2011, 11:21
Derek012's Avatar
Derek012 Derek012 is offline
I miss my frisbees
FRC #4564 (Orange Chaos)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2009
Location: Maine
Posts: 25
Derek012 is on a distinguished road
Re: Cypress Switch Problem

I had a problem with the execution of my robot code when I deployed the code and tried to run the robot it wouldn't run the code in operator control

Code:
dio = DriverStation.getInstance().getEnhancedIO();
while (isOperatorControl()) {
            display.updateLCD();
            Camera(cam);
            
            gyro.setSensitivity(0.125);
            if (GyroAngle >= 360 || GyroAngle <= -360) {
                GyroAngle = GyroAngle % 360;
            }
            updateDashboard();
            PVal = (int) ((petOm.getVoltage()) * 10);
            //dsLCD.println(DriverStationLCD.Line.kMain6, 1, "Arm Angle " + PVal);
            //dsLCD.println(DriverStationLCD.Line.kUser2, 1, "Light " + light.getAverageValue());
            //dsLCD.println(DriverStationLCD.Line.kUser3, 1, "Gyro Angle " + GyroAngle);
            dio = DriverStation.getInstance().getEnhancedIO();
            try {
                if (dio.getDigital(1)) {
                    photosense(rite, left, middle);
                    dio = DriverStation.getInstance().getEnhancedIO();
                } if (!dio.getDigital(1)) {
                    if (dio.getDigital(3)) {
                        FullSpeed(r1, r2, l1, l2, rightStick);
                        dio = DriverStation.getInstance().getEnhancedIO();
                    }
                    if (!dio.getDigital(3)) {
                        HalfSpeed(r1, r2, l1, l2, rightStick);
                        dio = DriverStation.getInstance().getEnhancedIO();
                    }
                    dio = DriverStation.getInstance().getEnhancedIO();
                }
            } catch (EnhancedIOException ex) {
                ex.printStackTrace();
            }
            dio = DriverStation.getInstance().getEnhancedIO();
        }
        dio = DriverStation.getInstance().getEnhancedIO();
    }

Last edited by Derek012 : 05-02-2011 at 11:24. Reason: Code Mistake
Reply With Quote