Arben Nikqi
/
Oppgave51a
Oppgave 5.1a
main.cpp@1:37a4f8f93b05, 2017-10-03 (annotated)
- Committer:
- Smashftw
- Date:
- Tue Oct 03 10:31:51 2017 +0000
- Revision:
- 1:37a4f8f93b05
- Parent:
- 0:bf2a26f06012
Oppgave51a
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Smashftw | 0:bf2a26f06012 | 1 | #include "mbed.h" |
Smashftw | 0:bf2a26f06012 | 2 | |
Smashftw | 0:bf2a26f06012 | 3 | DigitalOut myled(LED1); |
Smashftw | 1:37a4f8f93b05 | 4 | void blink1(void); |
Smashftw | 0:bf2a26f06012 | 5 | |
Smashftw | 1:37a4f8f93b05 | 6 | int main() |
Smashftw | 1:37a4f8f93b05 | 7 | { |
Smashftw | 1:37a4f8f93b05 | 8 | int n = 20; |
Smashftw | 1:37a4f8f93b05 | 9 | while(n>0) { |
Smashftw | 0:bf2a26f06012 | 10 | blink1(); |
Smashftw | 0:bf2a26f06012 | 11 | n--; |
Smashftw | 1:37a4f8f93b05 | 12 | } |
Smashftw | 1:37a4f8f93b05 | 13 | return 0; |
Smashftw | 0:bf2a26f06012 | 14 | } |
Smashftw | 1:37a4f8f93b05 | 15 | void blink1(void) |
Smashftw | 1:37a4f8f93b05 | 16 | { |
Smashftw | 0:bf2a26f06012 | 17 | myled =1; |
Smashftw | 0:bf2a26f06012 | 18 | wait(0.2); |
Smashftw | 0:bf2a26f06012 | 19 | myled =0; |
Smashftw | 0:bf2a26f06012 | 20 | wait(0.3); |
Smashftw | 1:37a4f8f93b05 | 21 | } |