Anish updated the code to work with L152. RTC seems to causing issue. Will have to disable LSE.
Dependencies: mbed LoRaWAN-lib SX1276Lib
Diff: app/main.cpp
- Revision:
- 20:e75b3340d1c7
- Parent:
- 19:6f88d1cabaca
- Child:
- 21:e3052f1fa2a7
--- a/app/main.cpp Fri Jan 25 22:58:17 2019 +0000 +++ b/app/main.cpp Wed Jan 30 17:18:24 2019 +0000 @@ -889,7 +889,8 @@ } // Measure voltage preval - measurements[0] = (uint8_t) (BAT_PIN.read()*1000)/10; + float battery_reading = BAT_PIN.read()*1000; + measurements[0] = (uint8_t) rintf(battery_reading/10); // Start test relayPin = 1; @@ -899,13 +900,13 @@ void endTest(uint8_t *measurements) { // Measure endvals - int battery_reading = BAT_PIN.read()*1000; + float battery_reading = BAT_PIN.read()*1000; int vce_reading = VCE_PIN.read()*1000; int light_1_reading = LIGHT_1_PIN.read()*1000 - vce_reading; int light_2_reading = LIGHT_2_PIN.read()*1000 - vce_reading; int rh_reading = RH_PIN.read()*1000 - vce_reading; - measurements[1] = (uint8_t) (battery_reading/10); + measurements[1] = (uint8_t) rintf(battery_reading/10); measurements[2] = (uint8_t) light_1_reading; measurements[3] = (uint8_t) light_2_reading; measurements[4] = (uint8_t) rh_reading;