Update voltage measurement. Change ADC config setting.
Dependencies: BLE_API mbed nRF51822 X_NUCLEO_IDB0XA1
Fork of BLE_BatteryLevel_ADC_170608 by
Diff: main.cpp
- Revision:
- 22:ad0c52ec5bf9
- Parent:
- 21:245543d2eb2c
--- a/main.cpp Wed Jul 05 06:23:28 2017 +0000 +++ b/main.cpp Mon Jul 24 02:05:26 2017 +0000 @@ -87,11 +87,13 @@ while (true) { ble.waitForEvent(); // this will return upon any system event (such as an interrupt or a ticker wakeup) - //Read Anlog input voltage //batteryLevel = analogin.read()*100; - batteryLevel = analogin.read()* 1.2 * 30; // + + //Read Anlog input voltage + batteryLevel = analogin.read()* 1.2 * 3 * 10; batteryService->updateBatteryLevel(batteryLevel); } + /* // the magic battery processing batteryLevel++; @@ -100,6 +102,6 @@ } batteryService->updateBatteryLevel(batteryLevel); - } + } */ }