Keith Applegarth
/
Nucleo_blink_led
blink
main.cpp@0:a4e688c122ae, 2014-02-27 (annotated)
- Committer:
- applekeith
- Date:
- Thu Feb 27 03:06:04 2014 +0000
- Revision:
- 0:a4e688c122ae
1st try
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
applekeith | 0:a4e688c122ae | 1 | #include "mbed.h" |
applekeith | 0:a4e688c122ae | 2 | |
applekeith | 0:a4e688c122ae | 3 | DigitalOut myled(LED1); |
applekeith | 0:a4e688c122ae | 4 | |
applekeith | 0:a4e688c122ae | 5 | int main() { |
applekeith | 0:a4e688c122ae | 6 | while(1) { |
applekeith | 0:a4e688c122ae | 7 | myled = 1; // LED is ON |
applekeith | 0:a4e688c122ae | 8 | wait(0.2); // 200 ms |
applekeith | 0:a4e688c122ae | 9 | myled = 0; // LED is OFF |
applekeith | 0:a4e688c122ae | 10 | wait(1.0); // 1 sec |
applekeith | 0:a4e688c122ae | 11 | } |
applekeith | 0:a4e688c122ae | 12 | } |