View Single Post
  #8   Spotlight this post!  
Unread 12-11-2012, 20:06
2185Bilal's Avatar
2185Bilal 2185Bilal is offline
Driver, Ld. Programmer, Electrical
AKA: Bilal Majeed
FRC #2185 (Ramazoidz)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Toronto, Canada
Posts: 110
2185Bilal will become famous soon enough
Re: Java Code Deploying Help

sure here it is:

Code:
package team2185.code.exhibtionCode;

import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.Watchdog;

public class ExhibtionCode extends IterativeRobot {
    
    // DEFINING THE JAGUARS
    Jaguar lm1 = new Jaguar(1); // left motor
    Jaguar lm2 = new Jaguar(2);
    Jaguar rm1 = new Jaguar(3); // right motor
    Jaguar rm2 = new Jaguar(4);
    
    RobotDrive driveSys = new RobotDrive (lm1, lm2, rm1, rm2);
    
    Joystick control = new Joystick(1);
    
//****************************************************************************//    
    
    public void robotInit() {
        // INITIALIZATION CODE
        // code in here runs when the robot first starts up    
    }
    
    public void autonomousInit() {
        for(int i=0; i<4; i++){
            driveSys.drive(0.5,0);
            Timer.delay(2.0);
            driveSys.drive(0,0.75);
            Timer.delay(1.0);
        }
    }
    
    public void teleopInit() {
        // TELEOPERATED INTIALIZATION CODE
        // runs only once at the start of the teleop period
    }

//****************************************************************************//
    
    public void autonomousPeriodic() {
        // called periodically during the autonomous period
    }
    
    public void teleopPeriodic() {
        if (control.getRawButton(1)){ // if button 1 pressed drive at full speed
            driveSys.tankDrive(control, 2, control, 5);
        }else {                       // else drive at half speed 
            driveSys.tankDrive(control, 2, control, 5);
            driveSys.setMaxOutput(0.5);
        }
    }

//****************************************************************************//
    
    public void disabledInit() {
        driveSys.drive(0.0, 0.0);
    }
}
__________________
RAMAZOIDZ

2009 Toronto West Regional - Regional Winners
2009 Waterloo Regional - Regional Winners
Reply With Quote