Skip to content

Commit

Permalink
Add RobotInit for some testing I didn't commit
Browse files Browse the repository at this point in the history
  • Loading branch information
StripedMonkey committed Mar 23, 2019
1 parent 7c45cb6 commit cc3fb8f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/main/cpp/Robot.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#include "Robot.h"
#include <iostream>

void Robot::RobotInit() {

}

void Robot::RobotPeriodic()
{

Expand All @@ -22,18 +26,22 @@ void Robot::TeleopPeriodic()
void Robot::PlayerControl() {

// Drive with arcade style controls
speed += (controller.GetRawAxis(5) - previousSpeed)/64;
speed += (controller.GetRawAxis(5) - previousSpeed)/8;
diffDrive.ArcadeDrive(-speed, controller.GetRawAxis(4) * .8);
previousSpeed = speed;

//"Intake mode" that allows the user to set the intake running constantly until a ball is caught
if (controller.GetRawButton(9) && (controller.GetRawAxis(2) == 0))
if (controller.GetRawButton(9) && (controller.GetRawAxis(2) < .02))
{
cargoMotor.Set(.2);
intakeMode = true;
}
if (controller.GetRawAxis(2) > 0)
if (controller.GetRawAxis(2) > .02)
{
intakeMode = false;
cargoMotor.Set(controller.GetRawAxis(2));
} else if (!intakeMode) {
cargoMotor.Set(0);
}
}

Expand Down
1 change: 1 addition & 0 deletions src/main/include/Robot.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class Robot : public frc::TimedRobot

//As these are the only two classes we utilize they are the only two overridden
void RobotPeriodic() override;
void RobotInit() override;
void TeleopPeriodic() override;
void AutonomousPeriodic() override;
void PlayerControl();
Expand Down

0 comments on commit cc3fb8f

Please sign in to comment.