My fork
Dependencies: BLE_API mbed-dev-bin nRF51822-bluetooth-mdw
Fork of microbit-dal-bluetooth-mdw by
Diff: source/drivers/MicroBitLightSensor.cpp
- Revision:
- 8:ec4465853952
- Parent:
- 1:8aa5cdb4ab67
--- a/source/drivers/MicroBitLightSensor.cpp Thu Apr 07 23:39:33 2016 +0100 +++ b/source/drivers/MicroBitLightSensor.cpp Thu Apr 07 23:39:34 2016 +0100 @@ -87,6 +87,9 @@ { this->chan = 0; + for(int i = 0; i < MICROBIT_LIGHT_SENSOR_CHAN_NUM; i++) + results[i] = 0; + if (EventModel::defaultEventBus) EventModel::defaultEventBus->listen(MICROBIT_ID_DISPLAY, MICROBIT_DISPLAY_EVT_LIGHT_SENSE, this, &MicroBitLightSensor::startSensing, MESSAGE_BUS_LISTENER_IMMEDIATE); @@ -174,4 +177,4 @@ { if (EventModel::defaultEventBus) EventModel::defaultEventBus->ignore(MICROBIT_ID_DISPLAY, MICROBIT_DISPLAY_EVT_LIGHT_SENSE, this, &MicroBitLightSensor::startSensing); -} +} \ No newline at end of file