Adam Lawrence / Mbed 2 deprecated smartSafe

Dependencies:   4DGL-uLCD-SE DebounceIn Motordriver PinDetect SDFileSystem mbed-rtos mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers solenoid.h Source File

solenoid.h

00001 #include "mbed.h"
00002 //Solenoid Hello World
00003 //Non blocking with auto off and min off-time delay using timer interrupt and timer setup by class
00004 class Solenoid
00005 {
00006 public:
00007     Solenoid (PinName pin, float ondelay=0.5, float offdelay=2.0);
00008     void write(bool state);
00009     Solenoid& operator= (bool value);
00010  
00011 private:
00012     void Solenoid_Off_Int();
00013     DigitalOut _pin;
00014     Timeout tint;
00015     Timer offtimer;
00016     float ontime;
00017     float offtime;
00018 };