Arduino Forum
>
Products
>
MKR Boards
>
MKRZero
(Moderator:
AndreaRichetta
)
>
detect if USB is plugged in ?
Print
Go Down
Pages:
[1]
Topic: detect if USB is plugged in ?
(Read 2360 times)
previous topic
-
next topic
Dirk67
Full Member
Posts: 186
Karma: 13
[add]
detect if USB is plugged in ?
Dec 14, 2016, 04:43 pm
Last Edit
: Dec 14, 2016, 04:48 pm by Dirk67
MKRZero:
is it possible to detect from the processor (within my sketch),
if the USB is plugged in/or not ?
(regardless of serial communication / only detecting the presence of 5V VUSB ?)
(need it for MSD bootloader)
arduino powered car relais / car "micro PLC" / with USB --> http://goo.gl/ofWFW3
a_guadalupi
MKR1000
Jr. Member
Posts: 55
Karma: 19
[add]
http://www.xanderelectronics.com/
Re: detect if USB is plugged in ?
#1
Dec 20, 2016, 11:09 am
Hi, yes it is possible but isn't a built in-function.
What you can do is test if there are or not the 5V. This voltage is there only if the USB is plugged. So if you scale down this voltage (voltage divider) to 3.3V using digitalRead() if you have HIGH USB is plugged, otherwise not!
Hope this help
Print
Go Up
Pages:
[1]
Loading...