mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Moves C++ templates and examples to match gradle setup (#1065)
This commit is contained in:
committed by
Peter Johnson
parent
d564e19ef3
commit
cff475c1fc
@@ -0,0 +1,29 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include <IterativeRobot.h>
|
||||
#include <Joystick.h>
|
||||
#include <Spark.h>
|
||||
|
||||
/**
|
||||
* This sample program shows how to control a motor using a joystick. In the
|
||||
* operator control part of the program, the joystick is read and the value is
|
||||
* written to the motor.
|
||||
*
|
||||
* Joystick analog values range from -1 to 1 and speed controller inputs as
|
||||
* range from -1 to 1 making it easy to work together.
|
||||
*/
|
||||
class Robot : public frc::IterativeRobot {
|
||||
public:
|
||||
void TeleopPeriodic() override { m_motor.Set(m_stick.GetY()); }
|
||||
|
||||
private:
|
||||
frc::Joystick m_stick{0};
|
||||
frc::Spark m_motor{0};
|
||||
};
|
||||
|
||||
START_ROBOT_CLASS(Robot)
|
||||
Reference in New Issue
Block a user