From ce28d23c4b3aa0ece677c52b14a34d92576ce124 Mon Sep 17 00:00:00 2001 From: Adam Long Date: Fri, 20 Feb 2015 16:27:39 +0000 Subject: [PATCH] Added solenoid subsystem --- Subsystems/Pnuematics.cpp | 19 +++++++++++++++++++ Subsystems/Pnuematics.h | 15 +++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 Subsystems/Pnuematics.cpp create mode 100644 Subsystems/Pnuematics.h diff --git a/Subsystems/Pnuematics.cpp b/Subsystems/Pnuematics.cpp new file mode 100644 index 0000000..d2840a2 --- /dev/null +++ b/Subsystems/Pnuematics.cpp @@ -0,0 +1,19 @@ +#include "Pnuematics.h" +#include "../RobotMap.h" + +Pnuematics::Pnuematics() : Subsystem("Pnuematics"){ + solenoid1 = new Solenoid(BINELEVATOR_SOLDENOID_ONE); + solenoid2 = new Solenoid(BINELEVATOR_SOLDENOID_TWO); +} +void Pnuematics::InitDefaultCommand(){ +} +void Pnuematics::SetOpen(bool k){ + if(k){ + solenoid1->Set(true); + solenoid2->Set(false); + }else{ + solenoid1->Set(false); + solenoid2->Set(true); + } +} +// vim: ts=2:sw=2:et diff --git a/Subsystems/Pnuematics.h b/Subsystems/Pnuematics.h new file mode 100644 index 0000000..cbc0152 --- /dev/null +++ b/Subsystems/Pnuematics.h @@ -0,0 +1,15 @@ +#ifndef PNUEMATICS_H +#define PNUEMATICS_H + +#include "WPILib.h" +class Pnuematics: public Subsystem +{ + private: + Solenoid *solenoid1, *solenoid2; + public: + Pnuematics(); + void InitDefaultCommand(); + void SetOpen(bool); +}; +#endif +// vim: ts=2:sw=2:et