Bryce Himebaugh / Mbed OS newblinker

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

main.cpp

Committer:
bhimebau
Date:
2018-01-23
Revision:
57:a3c0babfccea
Parent:
56:939270a94e87
Child:
58:f1306dbfb574

File content as of revision 57:a3c0babfccea:

#include "mbed.h"

DigitalOut led1(LED1);
Serial pc(USBTX, USBRX);
DigitalIn button(PC_13);

// main() runs in its own thread in the OS
int main() {
    while (true) {
        if (button.read()) led1 = 1;
        else led1=0;
        //pc.putc(pc.getc());
        //led1 = !led1;
        //if (led1) {
        //    pc.printf("ON\n\r");
        //    wait(2);
       // }
       // else {
       //     pc.printf("OFF\n\r");
        //    wait(1);
       // }
          
    }
}