How to get battery volt / percentage message send to mqtt?
-
@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
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login