I have an arduino MKR1010WiFi settled on an IOT carrier, is a mobile application device so
Im trying to make a while statement to be run while vusb is connected.
so as i ccould make my sketch react differently when connected to external power as it's not suposed to run while charging bateries
I've read and search a lot but I can't find a pin, a variable, or anything to look at, to achieve this by software.
I've seen this could be possible in other boards by looking some registers on th chip or variable changes ...
so here is my question: does anybody knows a way of doing this detection by software?
void loop()
{
while("*vusb is connected*") {
serial.print("usb charging mode");
}
the rest of the code
}
I'know it could be done by ading a voltage divider and reading voltage with any pin... but this is not an option in my project as I'm not allowed to add electronic parts besides the sensors or connectors already existents in the board/carrier.
Many thanks in advance
Ale