M5stickC turn on when connect Type-C USB with power (How to disable?)
-
When I plugin Type-C USB with power, M5stickC will turn on automatically. Is it possible to disable?
-
Hello @sgnp2091
do you mean disable by software or hardware?
The way M5StickC Plus is wired internally I don't think it is possible to disable this functionality by software, but I guess it would be possible by a hardware modification.
Thanks
Felix -
I would like to disable this function by Arduino. I don't want to modify the hardware. Btw, thank you for your reply.
-
Don't know if still relevant, but you can just power it off if you see it was plugged in.
I attach a basic code here, and you can tweak it to your needs of course.Be aware that you might need to use a small delay before M5.Axp.GetVBusVoltage() will give you a result you can trust.
//function which reads the voltage coming out of the USB, and if it's above 4.1 I know the device is being charged.
bool isBeingCharged()
{
float charge = M5.Axp.GetVBusVoltage();
//Serial.println(charge);
return charge > 4.1;
}//check here of anywhere you want in the code if the device is being charged, and power it off.
void setup()
{
if (isBeingCharged())
{
M5.Axp.PowerOff();
}
}
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login