mirror of
https://github.com/team2059/Dent
synced 2024-12-18 20:52:29 -05:00
Added compressor stopping. kinda works
This commit is contained in:
parent
e496f313df
commit
b4b54ee5e7
@ -1,18 +0,0 @@
|
||||
#include "Compress.h"
|
||||
#include <cmath>
|
||||
#include "../DentRobot.h"
|
||||
Compress::Compress() : Command("Compress"){
|
||||
Requires(DentRobot::airCompressor);
|
||||
}
|
||||
void Compress::Initialize(){
|
||||
}
|
||||
void Compress::Execute(){
|
||||
DentRobot::airCompressor->CreateCompressedAir();
|
||||
}
|
||||
bool Compress::IsFinished(){
|
||||
return false;
|
||||
}
|
||||
void Compress::End(){
|
||||
}
|
||||
void Compress::Interrupted(){
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
#ifndef COMPRESSOR_H
|
||||
#define COMPRESSOR_H
|
||||
|
||||
#include "../CommandBase.h"
|
||||
#include "../DentRobot.h"
|
||||
#include "Commands/Command.h"
|
||||
#include "WPILib.h"
|
||||
|
||||
class Compress: public Command{
|
||||
public:
|
||||
Compress();
|
||||
void Initialize();
|
||||
void Execute();
|
||||
bool IsFinished();
|
||||
void End();
|
||||
void Interrupted();
|
||||
};
|
||||
#endif
|
18
Commands/Compressor/StartCompressing.cpp
Normal file
18
Commands/Compressor/StartCompressing.cpp
Normal file
@ -0,0 +1,18 @@
|
||||
#include "StartCompressing.h"
|
||||
#include <cmath>
|
||||
#include "../../DentRobot.h"
|
||||
StartCompressing::StartCompressing() : Command("StartCompressing"){
|
||||
Requires(DentRobot::airCompressor);
|
||||
}
|
||||
void StartCompressing::Initialize(){
|
||||
}
|
||||
void StartCompressing::Execute(){
|
||||
DentRobot::airCompressor->CreateCompressedAir();
|
||||
}
|
||||
bool StartCompressing::IsFinished(){
|
||||
return false;
|
||||
}
|
||||
void StartCompressing::End(){
|
||||
}
|
||||
void StartCompressing::Interrupted(){
|
||||
}
|
18
Commands/Compressor/StartCompressing.h
Normal file
18
Commands/Compressor/StartCompressing.h
Normal file
@ -0,0 +1,18 @@
|
||||
#ifndef STARTCOMPRESSING_H
|
||||
#define STARTCOMPRESSING_H
|
||||
|
||||
#include "../../CommandBase.h"
|
||||
#include "../../DentRobot.h"
|
||||
#include "../../Commands/Command.h"
|
||||
#include "WPILib.h"
|
||||
|
||||
class StartCompressing: public Command{
|
||||
public:
|
||||
StartCompressing();
|
||||
void Initialize();
|
||||
void Execute();
|
||||
bool IsFinished();
|
||||
void End();
|
||||
void Interrupted();
|
||||
};
|
||||
#endif
|
18
Commands/Compressor/StopCompressing.cpp
Normal file
18
Commands/Compressor/StopCompressing.cpp
Normal file
@ -0,0 +1,18 @@
|
||||
#include "StopCompressing.h"
|
||||
#include <cmath>
|
||||
#include "../../DentRobot.h"
|
||||
StopCompressing::StopCompressing() : Command("StopCompressing"){
|
||||
Requires(DentRobot::airCompressor);
|
||||
}
|
||||
void StopCompressing::Initialize(){
|
||||
}
|
||||
void StopCompressing::Execute(){
|
||||
DentRobot::airCompressor->StopCreatingCompressedAir();
|
||||
}
|
||||
bool StopCompressing::IsFinished(){
|
||||
return false;
|
||||
}
|
||||
void StopCompressing::End(){
|
||||
}
|
||||
void StopCompressing::Interrupted(){
|
||||
}
|
18
Commands/Compressor/StopCompressing.h
Normal file
18
Commands/Compressor/StopCompressing.h
Normal file
@ -0,0 +1,18 @@
|
||||
#ifndef STOPCOMPRESSING_H
|
||||
#define STOPCOMPRESSING_H
|
||||
|
||||
#include "../../CommandBase.h"
|
||||
#include "../../DentRobot.h"
|
||||
#include "../../Commands/Command.h"
|
||||
#include "WPILib.h"
|
||||
|
||||
class StopCompressing: public Command{
|
||||
public:
|
||||
StopCompressing();
|
||||
void Initialize();
|
||||
void Execute();
|
||||
bool IsFinished();
|
||||
void End();
|
||||
void Interrupted();
|
||||
};
|
||||
#endif
|
3
Makefile
3
Makefile
@ -18,6 +18,9 @@ clean:
|
||||
$(CLEANSER) $(OBJECTS) bin/FRCUserProgram
|
||||
|
||||
deploy:
|
||||
@cat bin/FRCUserProgram | ssh admin@$(REMOTEIP) 'cat > /home/lvuser/FRCUserProgram2&&rm /home/lvuser/FRCUserProgram;mv /home/lvuser/FRCUserProgram2 /home/lvuser/FRCUserProgram&&. /etc/profile.d/natinst-path.sh;chmod a+x /home/lvuser/FRCUserProgram'
|
||||
|
||||
debug:
|
||||
@cat bin/FRCUserProgram | ssh admin@$(REMOTEIP) 'cat > /home/lvuser/FRCUserProgram2&&rm /home/lvuser/FRCUserProgram;mv /home/lvuser/FRCUserProgram2 /home/lvuser/FRCUserProgram&&. /etc/profile.d/natinst-path.sh;chmod a+x /home/lvuser/FRCUserProgram;/home/lvuser/run.sh'
|
||||
|
||||
putkey:
|
||||
|
2
OI.cpp
2
OI.cpp
@ -3,6 +3,8 @@
|
||||
#include "Commands/Raise.h"
|
||||
#include "Commands/Collect.h"
|
||||
#include "Commands/Eject.h"
|
||||
#include "Commands/Compressor/StartCompressing.h"
|
||||
#include "Commands/Compressor/StopCompressing.h"
|
||||
|
||||
OI::OI() {
|
||||
leftStick=new Joystick(0);
|
||||
|
@ -6,9 +6,13 @@ AirCompressor::AirCompressor() : Subsystem("AirCompressor") {
|
||||
}
|
||||
void AirCompressor::InitDefaultCommand() {
|
||||
}
|
||||
void AirCompressor::CreateCompressedAir() {
|
||||
int AirCompressor::CreateCompressedAir() {
|
||||
printf("compressing and stuff\n");
|
||||
compressher->Start();
|
||||
return 0;
|
||||
}
|
||||
void AirCompressor::StopCreatingCompressedAir() {
|
||||
int AirCompressor::StopCreatingCompressedAir() {
|
||||
printf("not compressing and stuff\n");
|
||||
compressher->Stop();
|
||||
return 0;
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ class AirCompressor: public Subsystem
|
||||
public:
|
||||
AirCompressor();
|
||||
void InitDefaultCommand();
|
||||
void CreateCompressedAir();
|
||||
void StopCreatingCompressedAir();
|
||||
int CreateCompressedAir();
|
||||
int StopCreatingCompressedAir();
|
||||
};
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user