mbed Workshops
/
Workshop-1-Example-1
A busy wait blinky implementation.
main.cpp@0:115f10501f59, 2016-09-26 (annotated)
- Committer:
- sarahmarshy
- Date:
- Mon Sep 26 16:11:24 2016 +0000
- Revision:
- 0:115f10501f59
Initial commit. Busy wait blinky.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sarahmarshy | 0:115f10501f59 | 1 | #include "mbed.h" |
sarahmarshy | 0:115f10501f59 | 2 | |
sarahmarshy | 0:115f10501f59 | 3 | DigitalOut myled(LED1); |
sarahmarshy | 0:115f10501f59 | 4 | |
sarahmarshy | 0:115f10501f59 | 5 | int main() { |
sarahmarshy | 0:115f10501f59 | 6 | while(1) { |
sarahmarshy | 0:115f10501f59 | 7 | myled = 1; |
sarahmarshy | 0:115f10501f59 | 8 | // printf("LED On\r\n"); |
sarahmarshy | 0:115f10501f59 | 9 | wait(0.2); |
sarahmarshy | 0:115f10501f59 | 10 | myled = 0; |
sarahmarshy | 0:115f10501f59 | 11 | // printf("LED Off \r\n"); |
sarahmarshy | 0:115f10501f59 | 12 | wait(0.2); |
sarahmarshy | 0:115f10501f59 | 13 | } |
sarahmarshy | 0:115f10501f59 | 14 | } |