Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import ccre.channel.*;
- import ccre.ctrl.*;
- import ccre.frc.*;
- import ccre.instinct.*;
- public class Test implements FRCApplication {
- public void setupRobot() {
- FloatInput leftAxis = FRC.joystick1.axis(2);
- FloatInput rightAxis = FRC.joystick1.axis(5);
- FloatOutput leftOut = FRC.talon(2, FRC.MOTOR_FORWARD);
- FloatOutput rightOut = FRC.talon(1, FRC.MOTOR_REVERSE);
- Drive.tank(leftAxis, rightAxis, leftOut, rightOut);
- BooleanOutput shifter = FRC.solenoid(2);
- shifter.setFalseWhen(FRC.startTele);
- shifter.setTrueWhen(FRC.joystick1.onPress(3));
- shifter.setFalseWhen(FRC.joystick1.onPress(1));
- FRC.registerAutonomous(new InstinctModule() {
- @Override
- protected void autonomousMain() throws AutonomousModeOverException, InterruptedException {
- leftOut.set(-1);
- rightOut.set(-1);
- waitForTime(5000);
- leftOut.set(0);
- rightOut.set(0);
- }
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement