How to write code Read/Measure the voltage on the battery that power the ESP8266?
You just need to use analogRead() and pass as an argument the pin in which you are reading the voltage.
Let me know if this helps.
Thank you for your reply.
The battery doesn’t connect to any pins.
I use Solar manager which connected to the battery and the kit.
I use the system as in this linkhttps://www.waveshare.com/solar-power-manager.htm
I thought you were using a battery without any module.
I’m not familiar with that module. But from the specs, it doesn’t seem to have any output to measure the current voltage. You would have to solder a wire to the terminals of the battery and measure the voltage on an analog pin.
You also have to take into account the maximum output voltage of the battery and that the ESP32 can only measure up to 3.3V.