
02-15-2016, 05:06 PM
|
 |
ArchdukeTim
 FRC #1418 (Vae Victis)
Team Role: Programmer
|
|
Join Date: Jan 2013
Rookie Year: 2011
Location: Falls Church
Posts: 232
|
|
|
Re: Please Help
Quote:
Originally Posted by CyberTeam5713
Code:
package org.usfirst.frc.team5713.robot;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.livewindow.LiveWindow;
import edu.wpi.first.wpilibj.Talon;
public class Robot extends IterativeRobot {
RobotDrive drive;
Joystick driveStick;
Joystick controlStick;
public void robotInit() {
Talon frontLeft = new Talon(1);
Talon rearLeft = new Talon(2);
Talon frontRight = new Talon(3);
Talon rearRight = new Talon(4);
drive = new RobotDrive(1,2,3,4);
driveStick = new Joystick(0);
controlStick = new Joystick(1);
public void teleopInit(){
}
public void teleopPeriodic() {
drive.setSafetyEnabled(true);
double joystickLeftY = driveStick.getRawAxis(2);
double joystickLeftX = driveStick.getRawAxis(1);
drive.arcadeDrive(joystickLeftY, joystickLeftX, true); }
|
This should work.
__________________
There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.
2012 - Gracious Professionalism - Greater DC
2014 - Regional Finalist - Virginia | Industrial Design - Virginia | Regional Finalist - Greater DC
2015 - Innovation in Control - Greater DC
2016 - District Event Winner - VAHAY | Innovation in Control - VAHAY | District Event Winner - MDBET | Industrial Design - MDBET | District Champion - CHCMP | Innovation in Control - CHCMP
|