Created
October 29, 2016 06:15
-
-
Save ajnadel/e712cd25ea9d30e85a49ab3434f87e6a to your computer and use it in GitHub Desktop.
Basic Robot Control & Movement — Offseason Chassis (Pinkie)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Manipulating motors | |
CANTalon leftWheel1 = new CANTalon(1); | |
CANTalon leftWheel2 = new CANTalon(2); | |
CANTalon rightWheel1 = new CANTalon(3); | |
CANTalon rightWheel2 = new CANTalon(4); | |
// ALWAYS SET WHEELS ON THE SAME SIDE TO THE SAME SPEED | |
rightWheel1.set(-1); // full backwards | |
rightWheel1.set(0); // stopped/not moving | |
rightWheel1.set(1); // full forwards | |
// Reading from a joystick | |
Joystick joystick = new Joystick(0); // OPTIONAL | |
double leftRightTilt = joystick.getX(); // between -1 and 1 | |
double forwardBackwardTile = joystick.getY(); // between -1 and 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment