Oppgave 2.1

Dependencies:   mbed

main.cpp

Committer:
olemh88
Date:
2017-09-05
Revision:
4:bfa6e8f625e2
Parent:
3:cdd8af1b6f39

File content as of revision 4:bfa6e8f625e2:

#include "mbed.h"

BusOut teller(p21, p22, p23, p24, p25, p26);
DigitalIn bryter(p20);
DigitalIn bryter2(p19);
Serial pc (USBTX, USBRX);

int main()
{
    int x=0;
    while(1) {
        pc.printf("%d",x);
        if (bryter2 ==1) {
            x=0;
        }
        teller =x;
        if (bryter ==1) {

            if ( x == 30) {
                x = 0;
            }
        }
        if ( x == 50) {
            x = 0;

        } else {

            x = x+1;
            wait(0.25);

        }
    }
}