mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-02 02:51:42 +00:00
Adds command examples to built examples (#1062)
This commit is contained in:
committed by
Peter Johnson
parent
7cd15aa049
commit
938d5379e6
@@ -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 "ReplaceMeCommand.h"
|
||||
|
||||
ReplaceMeCommand::ReplaceMeCommand() {
|
||||
// Use Requires() here to declare subsystem dependencies
|
||||
// eg. Requires(Robot::chassis.get());
|
||||
}
|
||||
|
||||
// Called just before this Command runs the first time
|
||||
void ReplaceMeCommand::Initialize() {}
|
||||
|
||||
// Called repeatedly when this Command is scheduled to run
|
||||
void ReplaceMeCommand::Execute() {}
|
||||
|
||||
// Make this return true when this Command no longer needs to run execute()
|
||||
bool ReplaceMeCommand::IsFinished() { return false; }
|
||||
|
||||
// Called once after isFinished returns true
|
||||
void ReplaceMeCommand::End() {}
|
||||
|
||||
// Called when another command which requires one or more of the same
|
||||
// subsystems is scheduled to run
|
||||
void ReplaceMeCommand::Interrupted() {}
|
||||
@@ -0,0 +1,20 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* 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. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Commands/Command.h>
|
||||
|
||||
class ReplaceMeCommand : public frc::Command {
|
||||
public:
|
||||
ReplaceMeCommand();
|
||||
void Initialize() override;
|
||||
void Execute() override;
|
||||
bool IsFinished() override;
|
||||
void End() override;
|
||||
void Interrupted() override;
|
||||
};
|
||||
Reference in New Issue
Block a user