View Single Post
  #4   Spotlight this post!  
Unread 15-01-2012, 00:26
ProgrammerMatt ProgrammerMatt is offline
Programmer-Electrical-Mechanical
FRC #0228 (Gus)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Southington
Posts: 138
ProgrammerMatt is just really niceProgrammerMatt is just really niceProgrammerMatt is just really niceProgrammerMatt is just really nice
Re: Robot not quite moving

I honestly have no clue what that is, That being said

Delete that, Goto file new project, FRC java folder, SimpleRobotTempleteProject,
Name it somthing
Ok now copy this code into there

YOU HAVE TO CHANGE THE "what ever you called it" no "" by the way
Code:
package edu.wpi.first.wpilibj.templates;

import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.SimpleRobot;


public class "what ever you named it" extends SimpleRobot {

joystick left, right;
RobotDrive drive;

public void robotInit() {

left = new Joystick(1);
right = new Joystick(2);

drive = new RobotDrive(1,2,3,4); // 1,2,3,4 are all PWM ports on side car, if only 2 motor drive take away the ,3,4
     }
}

public void autonomous() {

}


public void operatorControl() {

while(isOperatorControl()) {

drive.tankDrive(left.getY(),right.getY());
    }
}
This will get you driving with 2 joysticks on either a 2 or 4 motor drive train

P.S. Dont get scared at what you posted its 1000 times easier then that
Reply With Quote