2
0
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:
Adam Long 2015-01-29 19:53:11 +00:00
parent e496f313df
commit b4b54ee5e7
10 changed files with 85 additions and 40 deletions

View File

@ -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(){
}

View File

@ -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

View 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(){
}

View 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

View 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(){
}

View 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

View File

@ -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
View File

@ -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);

View File

@ -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;
}

View File

@ -9,7 +9,7 @@ class AirCompressor: public Subsystem
public:
AirCompressor();
void InitDefaultCommand();
void CreateCompressedAir();
void StopCreatingCompressedAir();
int CreateCompressedAir();
int StopCreatingCompressedAir();
};
#endif