elektro hiof / Mbed 2 deprecated Oppgave4-4

Dependencies:   mbed

Fork of Oppgave4-4 by elektro hiof

main.cpp

Committer:
tors
Date:
2014-10-17
Revision:
0:c26cdf21261a
Child:
1:e6e3af75f623

File content as of revision 0:c26cdf21261a:

#include "mbed.h"
DigitalOut LR(p18);
DigitalIn  B1(p20);

int main()
{
    float i;
    while(1) {

        while (B1==0) {

            wait(2.0);
            LR = 1;
            wait(2.0);
            LR = 0;
        }
        while(B1==1) {
            if(i>=2.0) {
                wait(i);
                LR=1;
                wait(0.2);
                LR=0;
            }

        }
    }
}