View Single Post
  #3   Spotlight this post!  
Unread 15-06-2012, 20:00
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
Post Re: Code and Deployment Help

Thank you for the help, I made the adjustments to the code as you instructed and this is how it looks like:
Code:
package bilal.eci.code.robotics;

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


public class ExhibtionMainClass extends IterativeRobot {
    
    Jaguar leftMotor1 = new Jaguar(1);  // define the 1st left motor 
    Jaguar leftMotor2 = new Jaguar(2);  // define the 2nd left motor
    
    Jaguar rightMotor1 = new Jaguar(3); // define the 1st right motor 
    Jaguar rightMotor2 = new Jaguar(4); // define the 2nd right motor 
    
        
    RobotDrive drive = new RobotDrive (leftMotor1, leftMotor2, rightMotor1, rightMotor2);   // define the robot drive system
    
    Joystick controller = new Joystick(1);
    
    public void robotInit() {
        
    }

    public void autonomousInit() {
        
        for(int i=0; i<4; i++){
            drive.drive(0.5,0.0);    // drive forward at 1/2 speed
            Timer.delay(2.0);        // wait 2 sec
            drive.drive(0.0, 0.75);  // drive with 0% speed and 75% turn
            Timer.delay(0.75);       // wait for the 90 degree turn to complete
            }
    }
    
    public void autonomousContinuous() {
        
    }
    public void autonomousPeriodic() {

    }

    public void telopInit(){
        while(isOperatorControl() && isEnabled())
        {
           
            
        }       
    }
    
    public void telopContinuous() {
        
    }
    
    public void teleopPeriodic() {
         drive.tankDrive(controller, 2, controller, 5);  // drive the robot according to joystick        
    }
    
    public void disabledInit() {
        drive.drive(0.0,0.0);        
    }
    
    public void disabledPeriodic() {
        
    }
    
    public void disabledContinuous() {
        
    }
}
Please do let me know if that is what you meant. Thank You Very Much

ps. I deleted the use of the button and i also deleted the shooter class
__________________
RAMAZOIDZ

2009 Toronto West Regional - Regional Winners
2009 Waterloo Regional - Regional Winners

Last edited by 2185Bilal : 15-06-2012 at 20:01. Reason: to add additional info
Reply With Quote