Detect USB is connected on esp32-s2
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- def1149
- Posts: 3
- Joined: Sat Jul 04, 2015 12:38 pm
Detect USB is connected on esp32-s2
How do I detect that the native USB is connected to PC? I use deep sleep and wake up on timer. When the esp32-s2 wakes up I'd like to detect if the USB is connected to the PC.
- mikeysklar
- Posts: 11740
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Detect USB is connected on esp32-s2
With CircuitPython you can for a PC connect by using:
You can try the suggestion here from a reddit thread that uses usb_dev.
If the above does't work out you could set a pin alarm and tie the USB power pin to another GPIO and use it as an interrupt.
Code: Select all
supervisor.runtime.serial_connected
supervisor.runtime.usb_connected
If the above does't work out you could set a pin alarm and tie the USB power pin to another GPIO and use it as an interrupt.
Please be positive and constructive with your questions and comments.