Skip to content
Ahmad-Bamba edited this page May 7, 2014 · 6 revisions

Pneumatics

Created class Pneumatics, does not inherit from anything

Constructor:

Pneumatics(class main_robot* r,
                   uint8_t digitalMod, uint32_t digitalChannel,
                   uint8_t compModuleNumber, uint32_t compChannel);

The constructor requires the robot pointer, and the mod and channels for the digital input

Created functions for checking pressure, setting our vector values updating the solenoids, and an update helper for update registry.

        void setVectorValues(double timerValues, DoubleSolenoid* startSolenoid, DoubleSolenoid::Value value);
        void updateSolenoid();
        static void updateHelper(void* instName);

One vector stores the values for the timers that tell us if the solenoid has expired. It also has vector of pointers to all our solenoids.

Pneumatics.cpp

Check pressure turns pneumatics off if the switch (digital input) is one. If it is 0, the pneumatics are turn on

void Pneumatics::checkPressure()
{
    if(switchObject->Get() == 1)
    {
        compressor->Set(Relay::kOff);
    }
    else
    {
        compressor->Set(Relay::kForward);
    }
}
Swag(){
   //implementation
}
Clone this wiki locally