Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 0:ae1f7d2c4fbc
- Child:
- 1:7d1fb66613d9
diff -r 000000000000 -r ae1f7d2c4fbc main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Thu May 18 08:01:11 2017 +0000
@@ -0,0 +1,20 @@
+#include "mbed.h"
+#include "USBSerial.h"
+
+USBSerial serial; // Virtual serial port over USB
+Serial uart(P0_19, P0_18);
+DigitalOut led(P0_20);
+
+int main(void) {
+ uart.baud(115200);
+ uart.format();
+
+ while(1) {
+ clock_t ts = clock();
+
+ led = !led;
+ uart.printf("Hello UART! %d\r\n", ts);
+ serial.printf("I am a virtual serial port %d\r\n", ts);
+ wait(3);
+ }
+}
\ No newline at end of file