elektro hiof / Mbed 2 deprecated Oppgave4-4

Dependencies:   mbed

Fork of Oppgave4-4 by elektro hiof

Committer:
tors
Date:
Fri Oct 17 11:48:37 2014 +0000
Revision:
0:c26cdf21261a
Child:
1:e6e3af75f623
.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tors 0:c26cdf21261a 1 #include "mbed.h"
tors 0:c26cdf21261a 2 DigitalOut LR(p18);
tors 0:c26cdf21261a 3 DigitalIn B1(p20);
tors 0:c26cdf21261a 4
tors 0:c26cdf21261a 5 int main()
tors 0:c26cdf21261a 6 {
tors 0:c26cdf21261a 7 float i;
tors 0:c26cdf21261a 8 while(1) {
tors 0:c26cdf21261a 9
tors 0:c26cdf21261a 10 while (B1==0) {
tors 0:c26cdf21261a 11
tors 0:c26cdf21261a 12 wait(2.0);
tors 0:c26cdf21261a 13 LR = 1;
tors 0:c26cdf21261a 14 wait(2.0);
tors 0:c26cdf21261a 15 LR = 0;
tors 0:c26cdf21261a 16 }
tors 0:c26cdf21261a 17 while(B1==1) {
tors 0:c26cdf21261a 18 if(i>=2.0) {
tors 0:c26cdf21261a 19 wait(i);
tors 0:c26cdf21261a 20 LR=1;
tors 0:c26cdf21261a 21 wait(0.2);
tors 0:c26cdf21261a 22 LR=0;
tors 0:c26cdf21261a 23 }
tors 0:c26cdf21261a 24
tors 0:c26cdf21261a 25 }
tors 0:c26cdf21261a 26 }
tors 0:c26cdf21261a 27 }