serial test
Fork of Minor_test_serial by
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "mbed.h" 00002 00003 DigitalOut myled(LED_GREEN); 00004 Serial pc(USBTX, USBRX, "YOLO"); 00005 00006 int main() 00007 { 00008 pc.baud(115200); 00009 pc.printf("Hello World!\n"); 00010 00011 while (true) { 00012 char c = pc.getc(); //get a character from the computer keyboard 00013 pc.printf("%c\r\n",c); //print the pressed character 00014 myled = !myled; // toggle the green LED 00015 } 00016 }
Generated on Sat Jul 16 2022 07:04:31 by
1.7.2
