Arben Nikqi
/
Oppgave51a
Oppgave 5.1a
main.cpp@0:bf2a26f06012, 2017-09-26 (annotated)
- Committer:
- Smashftw
- Date:
- Tue Sep 26 11:08:14 2017 +0000
- Revision:
- 0:bf2a26f06012
- Child:
- 1:37a4f8f93b05
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 | 0:bf2a26f06012 | 4 | |
Smashftw | 0:bf2a26f06012 | 5 | int main() |
Smashftw | 0:bf2a26f06012 | 6 | { |
Smashftw | 0:bf2a26f06012 | 7 | int n = 20; |
Smashftw | 0:bf2a26f06012 | 8 | while(n>0) { |
Smashftw | 0:bf2a26f06012 | 9 | blink1(); |
Smashftw | 0:bf2a26f06012 | 10 | n--; |
Smashftw | 0:bf2a26f06012 | 11 | }return 0; |
Smashftw | 0:bf2a26f06012 | 12 | } |
Smashftw | 0:bf2a26f06012 | 13 | void blink1(void){ |
Smashftw | 0:bf2a26f06012 | 14 | myled =1; |
Smashftw | 0:bf2a26f06012 | 15 | wait(0.2); |
Smashftw | 0:bf2a26f06012 | 16 | myled =0; |
Smashftw | 0:bf2a26f06012 | 17 | wait(0.3); |
Smashftw | 0:bf2a26f06012 | 18 | } |