Android sketch works with AXP192, but not 2101
-
I use this code below with AXP192 to determine if the USB power is on/off. I want to power off the core2 when USB pwr is removed. This works with AXP192 but not 2101. What code and libraries would be needed to work with the AXP2101? Also, would be nice if I could determine which AXP this is and use the proper commands. TIA,
Kris ```
code_text//----------------------------- power off CTB when USB is powered off ----------------------------------- void checkPWR() { battpwr = (M5.Axp.GetBatPower()); if (battpwr > 100) { // Check to see if USB power was removed. M5.Axp.PowerOff(); // Power M5 off } }
-
-
HI @felmue
Thanks for you reply. After trying to replace the M5core2 library with M5Unified, I see that I'll need to change and retest of number of things. RTC, Buttons, Lcd commands, etc. Is there no other way to address the AXP2101 other than using M5Unified?
Thanks,
Kris -