mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
32 lines
888 B
C
32 lines
888 B
C
|
|
// 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.
|
||
|
|
|
||
|
|
#pragma once
|
||
|
|
|
||
|
|
#include <frc/TimedRobot.h>
|
||
|
|
#include <frc/Timer.h>
|
||
|
|
#include <frc/XboxController.h>
|
||
|
|
#include <frc/drive/DifferentialDrive.h>
|
||
|
|
#include <frc/xrp/XRPMotor.h>
|
||
|
|
|
||
|
|
class Robot : public frc::TimedRobot {
|
||
|
|
public:
|
||
|
|
Robot();
|
||
|
|
void RobotPeriodic() override;
|
||
|
|
void AutonomousInit() override;
|
||
|
|
void AutonomousPeriodic() override;
|
||
|
|
void TeleopInit() override;
|
||
|
|
void TeleopPeriodic() override;
|
||
|
|
|
||
|
|
private:
|
||
|
|
frc::XRPMotor m_leftMotor{0};
|
||
|
|
frc::XRPMotor m_rightMotor{1};
|
||
|
|
frc::XboxController m_XboxController{0};
|
||
|
|
frc::Timer m_timer;
|
||
|
|
|
||
|
|
frc::DifferentialDrive m_drive{
|
||
|
|
[&](double output) { m_leftMotor.Set(output); },
|
||
|
|
[&](double output) { m_rightMotor.Set(output); }};
|
||
|
|
};
|