lewisxhe / AXP202X_Library

Arduino & ESP-IDF libraries written for AXP19x, 20x
MIT License
91 stars 40 forks source link

getVbusCurrent() and getVbusVoltage() not working #7

Closed cyberman54 closed 5 years ago

cyberman54 commented 5 years ago

Methods getVbusCurrent() and getVbusVoltage() are not working on T-Beam V1.0, result values are always zero while VBUS is present. I would expect to get USB voltage and current values while USB is plugged.

I checked schematic, AXP192 and AXP202 datasheets and code of library, but can't catch the problem. Need help.

lewisxhe commented 5 years ago

You must first enable adc

axp.adc1Enable(AXP202_VBUS_VOL_ADC1, 1);
axp.adc1Enable(AXP202_VBUS_CUR_ADC1, 1);

@cyberman54

cyberman54 commented 5 years ago

Works! Thanks for the hint.