How to get battery volt / percentage message send to mqtt?
Development
15
Posts
3
Posters
1.8k
Views
3
Watching
-
@gohan said in How to get battery volt / percentage message send to mqtt?:
delay(500)
Hi, tried that (already tried it with wait). Now I added it here:
delay(500); int sensorValue = analogRead(BATTERY_SENSE_PIN);Also tried it here:
if (oldBatteryPcnt != batteryPcnt) { // Power up radio after sleep delay(500); sendBatteryLevel(batteryPcnt); oldBatteryPcnt = batteryPcnt; } sleep(SLEEP_TIME); //sleep a bit ``` Both did not help still ending up with 0 . So what should be the best place the right place to put the delay? -
the second one is useless. It is odd that it misses the analog reads. What AVR boards version are you using?
-
Try a simple example sketch that reads the analog pin just to make sure the hardware is OK, or try another pro mini