Liviu Ionescu
/
mbed-os-example-blinky
my first blinky test
main.cpp@0:fcfcebd5a471, 2016-08-31 (annotated)
- Committer:
- ilg
- Date:
- Wed Aug 31 22:19:16 2016 +0000
- Revision:
- 0:fcfcebd5a471
first test
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ilg | 0:fcfcebd5a471 | 1 | #include "mbed.h" |
ilg | 0:fcfcebd5a471 | 2 | |
ilg | 0:fcfcebd5a471 | 3 | DigitalOut led1(LED1); |
ilg | 0:fcfcebd5a471 | 4 | |
ilg | 0:fcfcebd5a471 | 5 | // main() runs in its own thread in the OS |
ilg | 0:fcfcebd5a471 | 6 | // (note the calls to Thread::wait below for delays) |
ilg | 0:fcfcebd5a471 | 7 | int main() { |
ilg | 0:fcfcebd5a471 | 8 | while (true) { |
ilg | 0:fcfcebd5a471 | 9 | led1 = !led1; |
ilg | 0:fcfcebd5a471 | 10 | Thread::wait(500); |
ilg | 0:fcfcebd5a471 | 11 | } |
ilg | 0:fcfcebd5a471 | 12 | } |
ilg | 0:fcfcebd5a471 | 13 |