View Single Post
  #7   Spotlight this post!  
Unread 19-06-2012, 23:26
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

WOW...thank you very much

So i have made the adjustments you told me to, and here how it looks like:

Code:
// This code was created on Friday June 15, 2012 by Bilal Majeed
// This code is meant to be used on the exhibtion robot

package bilal.eci.code.robotics;

// OBJECTS // 
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;

// ROBOT CODE (AUTONOMOUS AND TELOP) // 
public class ExhibtionMainClass extends IterativeRobot {
    
    // DEFINING THE JAGUARS // 
    final Jaguar leftMotor1 = new Jaguar(1); 
    final Jaguar leftMotor2 = new Jaguar(2);  
    final Jaguar rightMotor1 = new Jaguar(3);  
    final Jaguar rightMotor2 = new Jaguar(4);     
        
    // DEFINING THE ROBOT DRIVE SYSTEM (4 WHEEL, TANK DRIVE) // 
    final RobotDrive drive = new RobotDrive (leftMotor1, leftMotor2, rightMotor1, rightMotor2);       
    
    // DEFINING THE JOYSTICK (USB1) // 
    final Joystick controller = new Joystick(1);
    
    // AUTONOMOUS CODE // 
    public void autonomousInit() {
        
        for(int i=0; i<4; i++){
            drive.drive(0.5,0.0);    
            Timer.delay(2.0);        
            drive.drive(0.0, 0.75);  
            Timer.delay(0.75);       
            }
    }
    
    // TELOPERATED PERIOD CODE // 
    public void teleopPeriodic() {
         drive.tankDrive(controller, 2, controller, 5);        
    }
    
    // DISABLED ROBOT CODE // 
    public void disabledInit() {
        drive.drive(0.0,0.0);        
    }
}
ps. Code is for our exhibition or display robot during the off-season, and it only includes a drive train

Let me know if i did anything wrong or differently, and also any tips or advice will be greatly appreciated, thank you

__________________
RAMAZOIDZ

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