examples/dual/dynamic_switch/README.md
This example demonstrates TinyUSB's dual-role capability by allowing runtime switching between USB device and host modes.
screen /dev/ttyACM0 or PuTTY)The onboard LED indicates the USB connection status:
The example prints status messages to the debug UART:
======================================
TinyUSB Dynamic Switch Example
Press button to switch between device and host modes
Starting in DEVICE mode...
======================================
[DEVICE] Mounted
--- Switching USB mode ---
Stopping DEVICE mode...
Starting HOST mode...
Mode switch complete!
[HOST] Device attached, address = 1
Device 1: ID 1234:5678 SN ABC123
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 0200
bDeviceClass 239
...