View Single Post
  #1   Spotlight this post!  
Unread 11-02-2015, 16:00
choas500 choas500 is offline
Registered User
FRC #4640
 
Join Date: Jan 2013
Location: frc
Posts: 4
choas500 is an unknown quantity at this point
need help programming arms with extra motor and talon

please help us
this is our code so far..

package org.usfirst.frc.team4640.robot;


import edu.wpi.first.wpilibj.CameraServer;
import edu.wpi.first.wpilibj.SampleRobot;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.Timer;



public class Robot extends SampleRobot {
RobotDrive myRobot; // class that handles basic drive operations
Joystick leftStick; // set to ID 1 in DriverStation
Joystick rightStick; // set to ID 2 in DriverStation
CameraServer server;

public Robot() {
myRobot = new RobotDrive(0, 1);
myRobot.setExpiration(0.1);
leftStick = new Joystick(0);
rightStick = new Joystick(1);
server = CameraServer.getInstance();
server.setQuality(50);
//the camera name (ex "cam0") can be found through the roborio web interface
server.startAutomaticCapture("cam0");

}


/**
* Runs the motors with tank steering.
*/
public void operatorControl() {
myRobot.setSafetyEnabled(true);
while (isOperatorControl() && isEnabled()) {
myRobot.tankDrive(leftStick, rightStick);
Timer.delay(0.005); // wait for a motor update time



}

}
}
Reply With Quote