Bryce Himebaugh / Mbed OS newblinker

Fork of mbed-os-example-mbed5-blinky by mbed-os-examples

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 DigitalOut led1(LED1);
00004 Serial pc(USBTX, USBRX);
00005 DigitalIn button(PC_13);
00006 
00007 // main() runs in its own thread in the OS
00008 // Message to Bryce. 
00009 
00010 int main() {
00011     while (true) {
00012         if (button.read()) led1 = 1;
00013         else led1=0;
00014     //  pc.putc(pc.getc());
00015         //led1 = !led1;
00016         //if (led1) {
00017         //    pc.printf("ON\n\r");
00018         //    wait(2);
00019        // }
00020        // else {
00021        //     pc.printf("OFF\n\r");
00022         //    wait(1);
00023        // }
00024           
00025     }
00026 }
00027