Hello, I’m trying to read the batterie i’ve pluged to back batterie pin but I only get 0 as value when I use the code given as example by Heltec. Does someone have an idea of how I can fix that ?
HTCC-AB01 batterie reading
I have a second board on wich I only read 2 no matters if th batterie is plug or not
You are using the sample code. Send it out and have a look.
#include "Arduino.h"
#include "LoRaWan_APP.h"
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
}
void loop() {
// put your main code here, to run repeatedly:
uint16_t voltage = getBatteryVoltage();
Serial.println(voltage);
delay(1000);
}
I’m using this simple code and the batterie is pluged on th back pin.
Check the log.
09:26:10.692 -> Copyright @2019-2020 Heltec Automation.All rights reserved.
09:26:10.927 -> 3968
09:26:11.956 -> 3940
09:26:12.984 -> 3930
09:26:14.009 -> 3952
09:26:15.028 -> 3950
09:26:16.053 -> 3936
09:26:17.075 -> 3934
09:26:18.095 -> 3914
09:26:19.115 -> 3970
09:26:20.143 -> 3942
09:26:21.207 -> 3950
09:26:22.226 -> 3942
09:26:23.248 -> 3960
09:26:24.274 -> 3966
09:26:25.302 -> 3904
09:26:26.328 -> 3886
09:26:27.353 -> 3940
09:26:28.373 -> 3890
09:26:29.441 -> 3902
09:26:30.463 -> 3892
09:26:31.486 -> 3876
09:26:32.510 -> 3894
09:26:33.535 -> 3902
09:26:34.558 -> 3866
09:26:35.585 -> 3968
09:26:36.613 -> 3970
09:26:37.640 -> 3954
09:26:38.663 -> 3974
09:26:39.688 -> 3978
09:26:40.759 -> 3946
09:26:41.786 -> 4004
09:26:42.808 -> 3906
09:26:43.827 -> 3940
09:26:44.854 -> 3918
09:26:45.875 -> 3924
09:26:46.899 -> 3956
09:26:47.922 -> 3864
09:26:48.948 -> 3924
Hi @mathieuvaudry, I have your same problem. Did you manage to solve it?
EDIT: Found the solution here: HTCC-AB01 V2 does not show the battery level