![](/media/cache/profiles/9bd5ee6fe55aaeb673025dbcb8f939c1.50x50_q85.jpg)
USBSerial Hello World
Fork of USBSerial_HelloWorld by
USBSerial Hello world example code.
Diff: main.cpp
- Revision:
- 10:d74aaa6c1f4e
- Parent:
- 9:d88699a0905a
--- a/main.cpp Fri Mar 01 13:33:02 2013 +0000 +++ b/main.cpp Tue Aug 07 15:56:53 2018 +0000 @@ -1,14 +1,17 @@ #include "mbed.h" #include "USBSerial.h" -//Virtual serial port over USB -USBSerial serial; - +USBSerial serial; // 9600 bps +DigitalOut led(LED1); + int main(void) { - + + int count = 0; + serial.printf("Hello, Mbed world.\n\n"); while(1) { - serial.printf("I am a virtual serial port\r\n"); - wait(1); + led = !led; + serial.printf("count = %d\n", count++); + wait(0.5); } } \ No newline at end of file