Go to Post Travel is a LOT less expensive when you pack the grown ups in the crate. - Rich Kressly [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 04-02-2011, 18:00
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
Cypress Switch Problem

Hey,
I've got two switches connected up to our team's Cypress board and I wanted one switch if it was false to be able to make the robot drive with joystick, but if it was true I wanted it to photo sense.

Code:
while (isOperatorControl()) {
            gyro.setSensitivity(0.125);
            dsLCD.updateLCD();
            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);
            ds = DriverStation.getInstance();
            if (ds.getDigitalIn(1)) {
                photosense(rite, left, middle);
                ds = DriverStation.getInstance();

            }
            else
                {
                if (ds.getDigitalIn(3)) {
                    FullSpeed(r1, r2, l1, l2, rightStick);
                    ds = DriverStation.getInstance();

                }
                if (!ds.getDigitalIn(3)) {
                    HalfSpeed(r1, r2, l1, l2, rightStick);
                    ds = DriverStation.getInstance();
                }
                ds = DriverStation.getInstance();
            }
        }
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


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

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