![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
A simple program to Toggle the 2 OnBoard LEDs.
Fork of Blinky_Led2 by
main.cpp@0:889636b54b07, 2018-05-15 (annotated)
- Committer:
- RGurav
- Date:
- Tue May 15 14:43:30 2018 +0000
- Revision:
- 0:889636b54b07
- Child:
- 1:c8bf330e87ba
Toggles the 2 onBoard LEDs.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
RGurav | 0:889636b54b07 | 1 | #include "mbed.h" |
RGurav | 0:889636b54b07 | 2 | |
RGurav | 0:889636b54b07 | 3 | DigitalOut led2(LED2); |
RGurav | 0:889636b54b07 | 4 | DigitalOut led1(LED1); |
RGurav | 0:889636b54b07 | 5 | |
RGurav | 0:889636b54b07 | 6 | // main() runs in its own thread in the OS |
RGurav | 0:889636b54b07 | 7 | int main() |
RGurav | 0:889636b54b07 | 8 | { |
RGurav | 0:889636b54b07 | 9 | led1 = 1; |
RGurav | 0:889636b54b07 | 10 | led2 = 0; |
RGurav | 0:889636b54b07 | 11 | |
RGurav | 0:889636b54b07 | 12 | while (true) |
RGurav | 0:889636b54b07 | 13 | { |
RGurav | 0:889636b54b07 | 14 | led2 = !led2; |
RGurav | 0:889636b54b07 | 15 | led1 = !led1; |
RGurav | 0:889636b54b07 | 16 | wait(0.5); |
RGurav | 0:889636b54b07 | 17 | } |
RGurav | 0:889636b54b07 | 18 | } |
RGurav | 0:889636b54b07 | 19 |