Inkplate-micropython
Inkplate-micropython copied to clipboard
Fix Inkplate 6 Color battery reading
Expected behavior:
Inkplate.readBattery should read the battery level of an Inkplate 6 Color
Actual behavior: The following error occurs:
Traceback (most recent call last):
File "<stdin>", line 22, in <module>
File "inkplate6_COLOR.py", line 467, in readBattery
AttributeError: type object 'Inkplate' has no attribute 'VBAT_EN'
Problem:
The GPIO pins were not being correctly initialized for reading the battery.
The readBattery function was not correctly using the PCAL6416A class
Solution:
Initialize GPIO pins for reading battery
Update readBattery function to properly read the voltage
Add a comment explaining the battery voltage calculation equation