Matt Landrum
/
STM32_Blink_LED
First Plain Blinky
main.cpp@0:b3f65381accb, 2019-01-09 (annotated)
- Committer:
- jmatt
- Date:
- Wed Jan 09 22:26:54 2019 +0000
- Revision:
- 0:b3f65381accb
First Blinky Example
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jmatt | 0:b3f65381accb | 1 | #include "mbed.h" |
jmatt | 0:b3f65381accb | 2 | #include "MyLib.h" |
jmatt | 0:b3f65381accb | 3 | |
jmatt | 0:b3f65381accb | 4 | DigitalOut led(LED1); |
jmatt | 0:b3f65381accb | 5 | |
jmatt | 0:b3f65381accb | 6 | int main() |
jmatt | 0:b3f65381accb | 7 | { |
jmatt | 0:b3f65381accb | 8 | while(1) { |
jmatt | 0:b3f65381accb | 9 | led = 1; // LED is ON |
jmatt | 0:b3f65381accb | 10 | wait(0.2); // 200 ms |
jmatt | 0:b3f65381accb | 11 | led = 0; // LED is OFF |
jmatt | 0:b3f65381accb | 12 | wait(0.8); // 800 ms |
jmatt | 0:b3f65381accb | 13 | } |
jmatt | 0:b3f65381accb | 14 | } |