Blink the onboard LED, and Print it's status in Serial
Fork of mbed-os-example-mbed5-blinky by
main.cpp
00001 #include "mbed.h" 00002 00003 DigitalOut led1(LED1); 00004 Serial pc(USBTX, USBRX); // tx, rx 00005 00006 // main() runs in its own thread in the OS 00007 int main() { 00008 while (true) { 00009 led1 = !led1; 00010 pc.printf("%sLed %s\n",(led1?"":"\t"),(led1?"ON":"OFF")); 00011 wait(0.5); 00012 } 00013 } 00014
Generated on Sun Jul 17 2022 00:30:26 by 1.7.2