M5Unified icon indicating copy to clipboard operation
M5Unified copied to clipboard

StickCP2.Power.getBatteryVoltage() and analogRead() conflict

Open cashlo opened this issue 6 months ago • 0 comments

I am using a M5StickC Plus2 with unit watering, and I want to monitor the battery level and the soil senor, but reading one seems to break the other.

For example:

StickCP2.Power.getBatteryVoltage(); // returns 4228
analogRead(33);                                   // returns 0
analogRead(33);                                   // returns 1770
StickCP2.Power.getBatteryVoltage(); // returns 0

This works fine

analogRead(33);                                   // returns 1770
analogRead(38);                                   // returns 2430

cashlo avatar Jul 06 '25 20:07 cashlo