Blink with busy waits

Dependencies:   mbed

Committer:
lmottola
Date:
Thu Nov 08 12:33:01 2018 +0000
Revision:
0:cbfa5cd9558b
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lmottola 0:cbfa5cd9558b 1 #include "mbed.h"
lmottola 0:cbfa5cd9558b 2
lmottola 0:cbfa5cd9558b 3 DigitalOut led(LED1);
lmottola 0:cbfa5cd9558b 4
lmottola 0:cbfa5cd9558b 5 int main()
lmottola 0:cbfa5cd9558b 6 {
lmottola 0:cbfa5cd9558b 7 while(1) {
lmottola 0:cbfa5cd9558b 8 led = 1; // LED is ON
lmottola 0:cbfa5cd9558b 9 wait(0.2); // 200 ms
lmottola 0:cbfa5cd9558b 10 led = 0; // LED is OFF
lmottola 0:cbfa5cd9558b 11 wait(0.8); // 800 ms
lmottola 0:cbfa5cd9558b 12 }
lmottola 0:cbfa5cd9558b 13 }