Zack Xiang / Mbed OS IoTSSC-lab1
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 // Ping
00003 // define the Serial object
00004 Serial pc(USBTX, USBRX);
00005 
00006 DigitalOut led1(LED1);
00007 
00008 int main() {
00009     while (true) {
00010         led1 = !led1;
00011 
00012         // Print something over the serial connection
00013         pc.printf("Blink! LED is now %d\r\n", led1.read());
00014 
00015         wait(0.5);
00016     }
00017 }