Moves C++ templates and examples to match gradle setup (#1065)

This commit is contained in:
Thad House
2018-05-15 21:25:24 -07:00
committed by Peter Johnson
parent d564e19ef3
commit cff475c1fc
112 changed files with 108 additions and 99 deletions

View File

@@ -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)