Hello world program (step 0) for the nRF51 and nRF52 developer kits used in the IoT Empire research workshop.
main.cpp@2:ab1ed6092e6d, 2017-03-28 (annotated)
- Committer:
- michaesc
- Date:
- Tue Mar 28 14:33:37 2017 +0000
- Revision:
- 2:ab1ed6092e6d
- Parent:
- 1:3ce7d0b39f17
Imported required mbed dependency library.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Michael Schloh von Bennewitz |
0:e7d3031b16e3 | 1 | #include "mbed.h" |
Michael Schloh von Bennewitz |
0:e7d3031b16e3 | 2 | |
Michael Schloh von Bennewitz |
0:e7d3031b16e3 | 3 | DigitalOut Led1(LED1); |
michaesc | 1:3ce7d0b39f17 | 4 | DigitalOut Led2(LED2); |
michaesc | 1:3ce7d0b39f17 | 5 | DigitalOut Led3(LED3); |
michaesc | 1:3ce7d0b39f17 | 6 | DigitalOut Led4(LED4); |
Michael Schloh von Bennewitz |
0:e7d3031b16e3 | 7 | |
Michael Schloh von Bennewitz |
0:e7d3031b16e3 | 8 | // main() runs in its own thread in the OS |
Michael Schloh von Bennewitz |
0:e7d3031b16e3 | 9 | int main() { |
Michael Schloh von Bennewitz |
0:e7d3031b16e3 | 10 | while (true) { |
Michael Schloh von Bennewitz |
0:e7d3031b16e3 | 11 | Led1 = !Led1; |
Michael Schloh von Bennewitz |
0:e7d3031b16e3 | 12 | wait(0.25); |
michaesc | 1:3ce7d0b39f17 | 13 | Led2 = !Led2; |
michaesc | 1:3ce7d0b39f17 | 14 | wait(0.25); |
michaesc | 1:3ce7d0b39f17 | 15 | Led4 = !Led4; |
michaesc | 1:3ce7d0b39f17 | 16 | wait(0.25); |
michaesc | 1:3ce7d0b39f17 | 17 | Led3 = !Led3; |
michaesc | 1:3ce7d0b39f17 | 18 | wait(0.25); |
Michael Schloh von Bennewitz |
0:e7d3031b16e3 | 19 | } |
michaesc | 1:3ce7d0b39f17 | 20 | } |