Thomas Chu
/
Nucleo_blink_led
LED hello world.
main.cpp@0:321920efbac6, 2017-02-15 (annotated)
- Committer:
- chu3098
- Date:
- Wed Feb 15 05:24:34 2017 +0000
- Revision:
- 0:321920efbac6
- Child:
- 1:b6bc26809ad3
First LED1 Blinky only.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
chu3098 | 0:321920efbac6 | 1 | #include "mbed.h" |
chu3098 | 0:321920efbac6 | 2 | |
chu3098 | 0:321920efbac6 | 3 | DigitalOut myled(LED1); |
chu3098 | 0:321920efbac6 | 4 | |
chu3098 | 0:321920efbac6 | 5 | int main() { |
chu3098 | 0:321920efbac6 | 6 | while(1) { |
chu3098 | 0:321920efbac6 | 7 | myled = 1; // LED is ON |
chu3098 | 0:321920efbac6 | 8 | wait(0.2); // 200 ms |
chu3098 | 0:321920efbac6 | 9 | myled = 0; // LED is OFF |
chu3098 | 0:321920efbac6 | 10 | wait(1.0); // 1 sec |
chu3098 | 0:321920efbac6 | 11 | } |
chu3098 | 0:321920efbac6 | 12 | } |