Bryce Himebaugh
/
newblinker
junk repo to test cli
Fork of mbed-os-example-mbed5-blinky by
main.cpp@58:f1306dbfb574, 2018-01-25 (annotated)
- Committer:
- Bryce Himebaugh
- Date:
- Thu Jan 25 08:03:24 2018 -0500
- Revision:
- 58:f1306dbfb574
- Parent:
- 57:a3c0babfccea
Here is my message.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Jonathan Austin |
0:2757d7abb7d9 | 1 | #include "mbed.h" |
Jonathan Austin |
0:2757d7abb7d9 | 2 | |
Jonathan Austin |
0:2757d7abb7d9 | 3 | DigitalOut led1(LED1); |
bhimebau | 57:a3c0babfccea | 4 | Serial pc(USBTX, USBRX); |
bhimebau | 57:a3c0babfccea | 5 | DigitalIn button(PC_13); |
Jonathan Austin |
0:2757d7abb7d9 | 6 | |
Jonathan Austin |
1:846c97078558 | 7 | // main() runs in its own thread in the OS |
Bryce Himebaugh |
58:f1306dbfb574 | 8 | // Message to Bryce. |
Bryce Himebaugh |
58:f1306dbfb574 | 9 | |
Jonathan Austin |
0:2757d7abb7d9 | 10 | int main() { |
Jonathan Austin |
0:2757d7abb7d9 | 11 | while (true) { |
bhimebau | 57:a3c0babfccea | 12 | if (button.read()) led1 = 1; |
bhimebau | 57:a3c0babfccea | 13 | else led1=0; |
Bryce Himebaugh |
58:f1306dbfb574 | 14 | // pc.putc(pc.getc()); |
bhimebau | 57:a3c0babfccea | 15 | //led1 = !led1; |
bhimebau | 57:a3c0babfccea | 16 | //if (led1) { |
bhimebau | 57:a3c0babfccea | 17 | // pc.printf("ON\n\r"); |
bhimebau | 57:a3c0babfccea | 18 | // wait(2); |
bhimebau | 57:a3c0babfccea | 19 | // } |
bhimebau | 57:a3c0babfccea | 20 | // else { |
bhimebau | 57:a3c0babfccea | 21 | // pc.printf("OFF\n\r"); |
bhimebau | 57:a3c0babfccea | 22 | // wait(1); |
bhimebau | 57:a3c0babfccea | 23 | // } |
bhimebau | 57:a3c0babfccea | 24 | |
Jonathan Austin |
0:2757d7abb7d9 | 25 | } |
Jonathan Austin |
0:2757d7abb7d9 | 26 | } |
Jonathan Austin |
1:846c97078558 | 27 |