![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Just a simple example of blinking led
Dependencies: mbed
Simple example of blinking led used as a starter to valid all the toolchain in Icarus Sensor System.
Diff: main.cpp
- Revision:
- 2:c76222c6370a
- Parent:
- 0:b729782a3ad7
- Child:
- 3:65d6deb7d07b
--- a/main.cpp Wed Nov 19 19:35:31 2014 +0000 +++ b/main.cpp Wed Nov 19 19:39:12 2014 +0000 @@ -1,17 +1,12 @@ #include "mbed.h" -DigitalOut myled1(p18); -DigitalOut myled2(p20); +DigitalOut led(LED1); //P0_18 in NRF51822_MKIT int main() { while(1) { - myled1 = 1; // LED is ON - wait(0.05); // 200 ms - myled1 = 0; // LED is OFF - wait(0.05); // 1 sec - myled2 = 1; // LED is ON - wait(0.05); // 200 ms - myled2 = 0; // LED is OFF - wait(0.05); // 1 sec + led = 1; // LED is ON + wait(0.05); // 50 ms + led = 0; // LED is OFF + wait(0.05); // 50 ms } } \ No newline at end of file