Oppgave 5.1a

Dependencies:   mbed

Committer:
Smashftw
Date:
Tue Oct 03 10:31:51 2017 +0000
Revision:
1:37a4f8f93b05
Parent:
0:bf2a26f06012
Oppgave51a

Who changed what in which revision?

UserRevisionLine numberNew 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 }