How check charging process
I need a function that will return whether the charge is connected or not. How?
Add in class code:
_REG_READ0 = const(0x70)
_CHARGE_EN = const(0b00000100)
...
...
@property
def charger_pluged(self):
charging_1 = self._register_char(_REG_READ0)
if charging_1 & _CHARGE_EN:
return True
else:
return False
Right?
Looking at the half Chinese language spec sheet I have, yes that looks correct. Did you test it out yet?
im testing that code today. Works not corrently( Works if i plug cable into Core, but not work if i plug cable into dock station (m5stack Fire)
I have a fire too for testing. Will play around with the code during the weekend.
@k4m454k take a look at what I just posted here: https://github.com/tuupola/micropython-m5stack/issues/6
But I only tested with the core, not the dock station.