Server for window shades - using Soffy DCT-30 motors - more details here http://robdobson.com/2013/10/moving-my-window-shades-control-to-mbed/

Dependencies:   EthernetInterface RdWebServer mbed-rtos mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers WindowShade.h Source File

WindowShade.h

00001 /* WindowShade.h
00002    Rob Dobson 2013
00003    More details at http://robdobson.com/2013/10/moving-my-window-shades-control-to-mbed/
00004 */
00005 
00006 #ifndef RD_WIN_SHADE
00007 #define RD_WIN_SHADE
00008 
00009 #include "mbed.h"
00010 
00011 class WindowShade
00012 {
00013     public:
00014         static const int MAX_SHADE_NAME_LEN = 20;
00015         static const long PULSE_ON_MILLISECS = 500;
00016         static const long MAX_SHADE_ON_MILLSECS = 60000;
00017         
00018         WindowShade(char* name, PinName up, PinName stop, PinName down);
00019         void ClearOutputs();
00020         void SetTimedOutput(DigitalOut* pPin, bool state, long msDuration, bool bClearExisting);
00021         void CheckTimeouts(int tickMs);
00022         void DoCommand(char* pDirn, char* pDuration);
00023     private:        
00024         char _shadeName[MAX_SHADE_NAME_LEN];
00025         DigitalOut* _pUpPin;
00026         DigitalOut* _pStopPin;
00027         DigitalOut* _pDownPin;
00028         long _msTimeout;
00029         int _tickCount;
00030         
00031 };
00032 
00033 #endif