
printf to UART
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:4a2f7ded5c1d
- Child:
- 1:76207e762bb4
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Jun 17 08:22:58 2018 +0000 @@ -0,0 +1,16 @@ +#include "mbed.h" + +Serial pc(USBTX, USBRX); + +DigitalOut led1(LED1); + +int main() { + while (true) { + led1 = !led1; + + // Print something over the serial connection + pc.printf("Blink! LED is now %d\r\n", led1.read()); + + wait(0.5); + } +} \ No newline at end of file