-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into DriveMotor
Conflicts: src/OI.cpp
- Loading branch information
Showing
3 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#include "StickOfJoy.h" | ||
|
||
StickOfJoy::StickOfJoy() { | ||
Requires(Robot::driveMotor.get()); | ||
// Use Requires() here to declare subsystem dependencies | ||
// eg. Requires(Robot::chassis.get()); | ||
} | ||
|
||
// Called just before this Command runs the first time | ||
void StickOfJoy::Initialize() { | ||
|
||
|
||
} | ||
|
||
// Called repeatedly when this Command is scheduled to run | ||
void StickOfJoy::Execute() { | ||
Robot::driveMotor->SetLeftMotor(Robot::oi->getJoystick1()->GetY()); | ||
Robot::driveMotor->SetRightMotor(Robot::oi->getJoystick1()->GetY()); | ||
} | ||
|
||
// Make this return true when this Command no longer needs to run execute() | ||
bool StickOfJoy::IsFinished() { | ||
return false; | ||
} | ||
|
||
// Called once after isFinished returns true | ||
void StickOfJoy::End() { | ||
|
||
} | ||
|
||
// Called when another command which requires one or more of the same | ||
// subsystems is scheduled to run | ||
void StickOfJoy::Interrupted() { | ||
Robot::driveMotor->StopLeftMotor(); | ||
Robot::driveMotor->StopRightMotor(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#ifndef StickOfJoy_H | ||
#define StickOfJoy_H | ||
|
||
#include "../CommandBase.h" | ||
|
||
class StickOfJoy : public CommandBase { | ||
public: | ||
StickOfJoy(); | ||
void Initialize(); | ||
void Execute(); | ||
bool IsFinished(); | ||
void End(); | ||
void Interrupted(); | ||
}; | ||
|
||
#endif // StickOfJoy_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters