Closed fustilio closed 4 years ago
Merged in https://github.com/m5stack/M5StickC/pull/104 Have some different?
Ah I see, there were some changes made to the master branch which I used to make previous PR before they were merged. I'll be more careful to make PRs from a separate branch in the future. I'll close this PR then. Thanks!
This PR consists of two functions that were required by our team, hoping to share with the rest of the community if they're useful.
Implement method to set target charging voltage
Writes to 6:5 bits of address 0x33 as per datasheet:
Implementation reads address and modifies only 6:5 bits
Usage:
M5.Axp.SetChargeVoltage(VOLTAGE_4360MV);
Implement method to set ADC sample rate
Writes to 7:6 bits of address 0x84 as per datasheet:
Implementation reads address and modifies only 7:6 bits
Usage:
M5.Axp.SetAdcRate(ADC_RATE_025HZ); // default is ADC_RATE_200HZ