File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change
1
+ ## USBCDC example
2
+
3
+ The example sends string in the loop using an emulated serial port over USB.
4
+
5
+ 1 . Flash the board, and ensure the target's auxiliary USB is plugged into the PC.
6
+ 2 . Open serial console (select associated COM port, transmission speed: 9600 bps).
7
+ 3 . Reset the target.
8
+ 4 . "Hello world" string should appear in the loop on the serial console in the 1-second delays.
9
+
10
+ ** Note:** On Windows you can check the associated COM port in the Device Manager (USB Serial Device).
11
+ ** Note:** If you want printf functionality, please see the USBSerial class.
Original file line number Diff line number Diff line change
1
+ #include " mbed.h"
2
+ #include " USBSerial.h"
3
+
4
+ // Virtual serial port over USB
5
+ USBSerial serial;
6
+
7
+ int main (void ) {
8
+ while (1 )
9
+ {
10
+ serial.printf (" I am a virtual serial port\r\n " );
11
+ wait (1.0 );
12
+ }
13
+ }
You can’t perform that action at this time.
0 commit comments