Moved battery measurement

This commit is contained in:
Anthony Hinsinger
2019-03-13 00:23:40 +01:00
parent c9c6a3d003
commit 36dfb179dd
+4 -4
View File
@@ -131,10 +131,6 @@ int main(void) {
static void send_message() { static void send_message() {
int16_t retcode; int16_t retcode;
#if MBED_CONF_APP_BATTERY_ENABLED && MBED_CONF_APP_BATTERY_IN_LPP
cayenne.addAnalogInput(MBED_CONF_APP_BATTERY_LPP_ID, battery_voltage());
#endif
#if MBED_CONF_APP_DHT_ENABLED #if MBED_CONF_APP_DHT_ENABLED
int err = dht.read(); int err = dht.read();
if(err == DHT::SUCCESS) { if(err == DHT::SUCCESS) {
@@ -153,6 +149,10 @@ static void send_message() {
loadcell.powerDown(); loadcell.powerDown();
#endif #endif
#if MBED_CONF_APP_BATTERY_ENABLED && MBED_CONF_APP_BATTERY_IN_LPP
cayenne.addAnalogInput(MBED_CONF_APP_BATTERY_LPP_ID, battery_voltage());
#endif
// No data to send // No data to send
if(cayenne.getSize() == 0) { if(cayenne.getSize() == 0) {
return; return;