Skip to content

Instantly share code, notes, and snippets.

@ArchdukeTim
Last active February 17, 2016 04:58
Show Gist options
  • Save ArchdukeTim/28c79cf382be21ffd4f5 to your computer and use it in GitHub Desktop.
Save ArchdukeTim/28c79cf382be21ffd4f5 to your computer and use it in GitHub Desktop.
#! /usr/bin/env python3
import wpilib
from robotpy_ext.control import xbox_controller
import magicbot
class MyRobot(magicbot.MagicRobot):
def createObjects(self):
self.driveStick = xbox_controller.XboxController(0)
self.lf_motor = wpilib.CANJaguar(1)
self.lr_motor = wpilib.CANJaguar(2)
self.rf_motor = wpilib.CANJaguar(3)
self.rr_motor = wpilib.CANJaguar(4)
self.drive = wpilib.RobotDrive(self.lf_motor, self.lr_motor, self.rf_motor, self.rr_motor)
def disabledPeriodic(self):
wpilib.Timer.delay(.01)
def teleopInit(self):
pass
def teleopPeriodic(self):
self.drive.tankDrive(self.driveStick.getLeftY(), self.driveStick.getRightY(), False)
if __name__ == '__main__':
wpilib.run(MyRobot)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment