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
WindowShade.h@4:c593741df37e, 2013-10-04 (annotated)
- Committer:
- Bobty
- Date:
- Fri Oct 04 10:38:42 2013 +0000
- Revision:
- 4:c593741df37e
- Parent:
- 2:24fd130c3600
Cosmetic only - no functional changes
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Bobty | 4:c593741df37e | 1 | /* WindowShade.h |
Bobty | 4:c593741df37e | 2 | Rob Dobson 2013 |
Bobty | 4:c593741df37e | 3 | More details at http://robdobson.com/2013/10/moving-my-window-shades-control-to-mbed/ |
Bobty | 4:c593741df37e | 4 | */ |
Bobty | 4:c593741df37e | 5 | |
Bobty | 2:24fd130c3600 | 6 | #ifndef RD_WIN_SHADE |
Bobty | 2:24fd130c3600 | 7 | #define RD_WIN_SHADE |
Bobty | 2:24fd130c3600 | 8 | |
Bobty | 2:24fd130c3600 | 9 | #include "mbed.h" |
Bobty | 2:24fd130c3600 | 10 | |
Bobty | 2:24fd130c3600 | 11 | class WindowShade |
Bobty | 2:24fd130c3600 | 12 | { |
Bobty | 2:24fd130c3600 | 13 | public: |
Bobty | 2:24fd130c3600 | 14 | static const int MAX_SHADE_NAME_LEN = 20; |
Bobty | 2:24fd130c3600 | 15 | static const long PULSE_ON_MILLISECS = 500; |
Bobty | 2:24fd130c3600 | 16 | static const long MAX_SHADE_ON_MILLSECS = 60000; |
Bobty | 2:24fd130c3600 | 17 | |
Bobty | 4:c593741df37e | 18 | WindowShade(char* name, PinName up, PinName stop, PinName down); |
Bobty | 4:c593741df37e | 19 | void ClearOutputs(); |
Bobty | 4:c593741df37e | 20 | void SetTimedOutput(DigitalOut* pPin, bool state, long msDuration, bool bClearExisting); |
Bobty | 4:c593741df37e | 21 | void CheckTimeouts(int tickMs); |
Bobty | 4:c593741df37e | 22 | void DoCommand(char* pDirn, char* pDuration); |
Bobty | 4:c593741df37e | 23 | private: |
Bobty | 2:24fd130c3600 | 24 | char _shadeName[MAX_SHADE_NAME_LEN]; |
Bobty | 2:24fd130c3600 | 25 | DigitalOut* _pUpPin; |
Bobty | 2:24fd130c3600 | 26 | DigitalOut* _pStopPin; |
Bobty | 2:24fd130c3600 | 27 | DigitalOut* _pDownPin; |
Bobty | 2:24fd130c3600 | 28 | long _msTimeout; |
Bobty | 2:24fd130c3600 | 29 | int _tickCount; |
Bobty | 2:24fd130c3600 | 30 | |
Bobty | 2:24fd130c3600 | 31 | }; |
Bobty | 2:24fd130c3600 | 32 | |
Bobty | 2:24fd130c3600 | 33 | #endif |