Cleaned up C++ examples (#672)

This commit is contained in:
Tyler Veness
2017-11-03 13:22:56 -07:00
committed by Peter Johnson
parent 6401aa1fde
commit 45d48d6b5a
69 changed files with 672 additions and 598 deletions

View File

@@ -9,7 +9,7 @@
ExampleCommand::ExampleCommand() {
// Use Requires() here to declare subsystem dependencies
// eg. Requires(Robot::chassis.get());
// eg. Requires(&Robot::chassis);
}
// Called just before this Command runs the first time

View File

@@ -0,0 +1,31 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017 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 "MyAutoCommand.h"
MyAutoCommand::MyAutoCommand() {
// Use Requires() here to declare subsystem dependencies
// eg. Requires(&Robot::chassis);
}
// Called just before this Command runs the first time
void MyAutoCommand::Initialize() {}
// Called repeatedly when this Command is scheduled to run
void MyAutoCommand::Execute() {}
// Make this return true when this Command no longer needs to run execute()
bool MyAutoCommand::IsFinished() {
return false;
}
// Called once after isFinished returns true
void MyAutoCommand::End() {}
// Called when another command which requires one or more of the same
// subsystems is scheduled to run
void MyAutoCommand::Interrupted() {}

View File

@@ -0,0 +1,20 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017 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. */
/*----------------------------------------------------------------------------*/
#pragma once
#include <Commands/Command.h>
class MyAutoCommand : public frc::Command {
public:
MyAutoCommand();
void Initialize() override;
void Execute() override;
bool IsFinished() override;
void End() override;
void Interrupted() override;
};