Version 3 is with update to the test rig with a linear actuator

Dependencies:   SPTE_10Bar_5V mbed AS5048 SDFileSystem MODSERIAL PinDetect LCM101 LinearActuator

Valve.h

Committer:
surajgiri
Date:
2020-08-12
Revision:
11:fc82dd22a527

File content as of revision 11:fc82dd22a527:

#ifndef _VALVEDIGITAL_H_
#define _VALVEDIGITAL_H_

#include "mbed.h"
/**
 * Controlling an on/off valve
 */

class ValveDigital
{
public:

    /**
     * @param pin_d_out PinName of digital output
     */
    ValveDigital (PinName pin_d_out) :
        digital_out_(pin_d_out)
    {
    }

    /**
     * @return valve state
     */
    float getValve()
    {
        return digital_out_.read();
    }

    /**
     * @
     */
    void setValve(bool set)
    {
        digital_out_.write((int)set);
        return;
    }


private:
    DigitalOut digital_out_;
};

#endif