Skip to content

Commit 2528e2f

Browse files
Add files via upload
1 parent 88a2f76 commit 2528e2f

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

src/main/cpp/Robot.cpp

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*----------------------------------------------------------------------------*/
2+
/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
3+
/* Open Source Software - may be modified and shared by FRC teams. The code */
4+
/* must be accompanied by the FIRST BSD license file in the root directory of */
5+
/* the project. */
6+
/*----------------------------------------------------------------------------*/
7+
8+
#include <frc/Joystick.h>
9+
#include <frc/TimedRobot.h>
10+
#include <frc/drive/DifferentialDrive.h>
11+
12+
#include "frc/WPILib.h"
13+
#include "ctre/Phoenix.h"
14+
15+
/**
16+
* This is a demo program showing the use of the DifferentialDrive class.
17+
* Runs the motors with arcade steering.
18+
*/
19+
class Robot : public frc::TimedRobot {
20+
WPI_VictorSPX * rightFront = new WPI_VictorSPX(3);//ID needs to be set
21+
WPI_VictorSPX * leftFront = new WPI_VictorSPX(4);//ID needs to be set
22+
WPI_VictorSPX * rightBack = new WPI_VictorSPX(5);//ID needs to be set
23+
WPI_VictorSPX * leftBack = new WPI_VictorSPX(6);//ID needs to be set
24+
rightBack -> Follow(rightFront::PercentOutput);
25+
frc::DifferentialDrive m_robotDrive{*rightFront, *leftFront};
26+
frc::Joystick m_stick{0};
27+
28+
public:
29+
void TeleopPeriodic() {
30+
// Drive with arcade style
31+
m_robotDrive.ArcadeDrive(m_stick.GetY(), m_stick.GetX());
32+
}
33+
};
34+
35+
#ifndef RUNNING_FRC_TESTS
36+
int main() { return frc::StartRobot<Robot>(); }
37+
#endif

src/main/deploy/example.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Files placed in this directory will be deployed to the RoboRIO into the
2+
'deploy' directory in the home folder. Use the 'frc::filesystem::GetDeployDirectory'
3+
function from the 'frc/Filesystem.h' header to get a proper path relative to the deploy
4+
directory.

src/test/cpp/main.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include <hal/HAL.h>
2+
3+
#include "gtest/gtest.h"
4+
5+
int main(int argc, char** argv) {
6+
HAL_Initialize(500, 0);
7+
::testing::InitGoogleTest(&argc, argv);
8+
int ret = RUN_ALL_TESTS();
9+
return ret;
10+
}

0 commit comments

Comments
 (0)