Version 3 is with update to the test rig with a linear actuator
Dependencies: SPTE_10Bar_5V mbed AS5048 SDFileSystem MODSERIAL PinDetect LCM101 LinearActuator
Diff: Valve.h
- Revision:
- 11:fc82dd22a527
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Valve.h Wed Aug 12 12:05:58 2020 +0000 @@ -0,0 +1,43 @@ +#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 \ No newline at end of file