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
Diff: MBEDLight.cpp
- Revision:
- 71:90bf61bc3727
- Parent:
- 47:fa96ddc36f04
- Child:
- 72:46c94966311b
--- a/MBEDLight.cpp Mon Mar 03 22:27:08 2014 +0000 +++ b/MBEDLight.cpp Mon Mar 03 22:39:48 2014 +0000 @@ -22,8 +22,10 @@ #include "LightSwitchAction.h" // MBED Light - PwmOut _light_1(LED2); - PwmOut _light_2(LED3); + extern DigitalOut led2; + extern DigitalOut led3; + PwmOut led_2(LED2); + PwmOut led_3(LED3); // default constructor MBEDLight::MBEDLight(ErrorHandler *error_handler,Transport *transports[NUM_TRANSPORTS],int instance,void *endpoint) : Light(error_handler,transports,instance,endpoint) { @@ -34,15 +36,15 @@ } // turn ON - void MBEDLight::on() { _light_1 = 1; _light_2 = 1; Light::on(); } + void MBEDLight::on() { led2 = 1; led3 = 1; Light::on(); } // turn OFF - void MBEDLight::off() { _light_1 = 0; _light_2 = 0; Light::off(); } + void MBEDLight::off() { led2 = 0; led3 = 0; Light::off(); } // dim void MBEDLight::dim(int value) { float dim_val = (float)(value/100.0); - _light_1.write(dim_val); - _light_2.write(dim_val); + led_2.write(dim_val); + led_3.write(dim_val); Light::dim(value); } \ No newline at end of file