-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to measure battery level? #38
Comments
With v1.0+ you can query the AXP chip with: |
tested on t-beam v1.1: #include <Wire.h>
// https://github.com/lewisxhe/AXP202X_Library
#include <axp20x.h>
AXP20X_Class axp;
void setup() {
// ...
Wire.begin(21, 22);
if(axp.begin(Wire, AXP192_SLAVE_ADDRESS) == AXP_FAIL) {
Serial.println(F("failed to initialize communication with AXP192"));
}
}
void loop() {
// ...
Serial.print(axp.getBattVoltage());
Serial.println(" mV");
} |
Hi, is the library https://github.com/lewisxhe/AXP202X_Library no longer maintained? Would there be an alternate lib? |
Lewis has created a library for all of the power chips LilyGO use: https://github.com/lewisxhe/XPowersLib/blob/master/examples/AXP202_Example/AXP202_Example.ino |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
There is any example on how to measure the battery level of hte TTGO T-Beam?
Thank you.
The text was updated successfully, but these errors were encountered: