Created
October 6, 2025 07:27
-
-
Save znotfireman/13434ad8ca6c3d7a2d4ae066fbc01339 to your computer and use it in GitHub Desktop.
Template code for FRC Programming October 6th 2025
This file contains hidden or 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
| // Copyright (c) FIRST and other WPILib contributors. | |
| // Open Source Software; you can modify and/or share it under the terms of | |
| // the WPILib BSD license file in the root directory of this project. | |
| package frc.robot; | |
| import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX; | |
| import edu.wpi.first.util.sendable.SendableRegistry; | |
| import edu.wpi.first.wpilibj.TimedRobot; | |
| import edu.wpi.first.wpilibj.XboxController; | |
| import edu.wpi.first.wpilibj.drive.DifferentialDrive; | |
| /** | |
| * The methods in this class are called automatically corresponding to each mode, as described in | |
| * the TimedRobot documentation. If you change the name of this class or the package after creating | |
| * this project, you must also update the manifest file in the resource directory. | |
| */ | |
| public class Robot extends TimedRobot { | |
| private final WPI_TalonSRX driveMotorLeft = new WPI_TalonSRX(10); | |
| private final WPI_TalonSRX driveMotorRight = new WPI_TalonSRX(2); | |
| private final DifferentialDrive drive = new DifferentialDrive(driveMotorLeft::set, driveMotorRight::set); | |
| private final XboxController controller = new XboxController(0); | |
| public Robot() { | |
| SendableRegistry.addChild(drive, driveMotorLeft); | |
| SendableRegistry.addChild(drive, driveMotorRight); | |
| driveMotorRight.setInverted(true); | |
| } | |
| @Override | |
| public void teleopPeriodic() { | |
| drive.arcadeDrive(controller.getLeftX(), -controller.getRightX()); | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment