Core Base Classes for the Light Endpoints
Dependents: mbed_mqtt_endpoint_ublox_ethernet mbed_mqtt_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_ethernet ... more
ExternalLEDLight.h@135:7f3f963cd159, 2014-03-28 (annotated)
- Committer:
- ansond
- Date:
- Fri Mar 28 17:49:10 2014 +0000
- Revision:
- 135:7f3f963cd159
- Parent:
- 105:759dee018363
- Child:
- 144:e4d24c2c8f18
updates
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ansond | 105:759dee018363 | 1 | /* Copyright C2013 Doug Anson, MIT License |
ansond | 105:759dee018363 | 2 | * |
ansond | 105:759dee018363 | 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software |
ansond | 105:759dee018363 | 4 | * and associated documentation files the "Software", to deal in the Software without restriction, |
ansond | 105:759dee018363 | 5 | * including without limitation the rights to use, copy, modify, merge, publish, distribute, |
ansond | 105:759dee018363 | 6 | * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is |
ansond | 105:759dee018363 | 7 | * furnished to do so, subject to the following conditions: |
ansond | 105:759dee018363 | 8 | * |
ansond | 105:759dee018363 | 9 | * The above copyright notice and this permission notice shall be included in all copies or |
ansond | 105:759dee018363 | 10 | * substantial portions of the Software. |
ansond | 105:759dee018363 | 11 | * |
ansond | 105:759dee018363 | 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING |
ansond | 105:759dee018363 | 13 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
ansond | 105:759dee018363 | 14 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
ansond | 105:759dee018363 | 15 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
ansond | 105:759dee018363 | 16 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
ansond | 105:759dee018363 | 17 | */ |
ansond | 105:759dee018363 | 18 | |
ansond | 105:759dee018363 | 19 | #ifndef _EXT_LED_LIGHT_H_ |
ansond | 105:759dee018363 | 20 | #define _EXT_LED_LIGHT_H_ |
ansond | 105:759dee018363 | 21 | |
ansond | 105:759dee018363 | 22 | #include "mbed.h" |
ansond | 105:759dee018363 | 23 | #include "Definitions.h" |
ansond | 135:7f3f963cd159 | 24 | #include "BaseClass.h" |
ansond | 105:759dee018363 | 25 | |
ansond | 135:7f3f963cd159 | 26 | class ExternalLEDLight : BaseClass { |
ansond | 105:759dee018363 | 27 | private: |
ansond | 105:759dee018363 | 28 | PwmOut *m_led; |
ansond | 105:759dee018363 | 29 | int m_state; |
ansond | 105:759dee018363 | 30 | float m_dim; |
ansond | 105:759dee018363 | 31 | bool m_dimming; |
ansond | 105:759dee018363 | 32 | |
ansond | 105:759dee018363 | 33 | public: |
ansond | 105:759dee018363 | 34 | ExternalLEDLight(PwmOut *led,ErrorHandler *error_handler); |
ansond | 135:7f3f963cd159 | 35 | virtual ~ExternalLEDLight(); |
ansond | 105:759dee018363 | 36 | |
ansond | 105:759dee018363 | 37 | void on(); |
ansond | 105:759dee018363 | 38 | void off(); |
ansond | 105:759dee018363 | 39 | void dim(int dim); // range: 0 - 100 |
ansond | 105:759dee018363 | 40 | void update(); |
ansond | 105:759dee018363 | 41 | }; |
ansond | 105:759dee018363 | 42 | |
ansond | 105:759dee018363 | 43 | #endif // _EXT_LED_LIGHT_H_ |