El-POM1001 / Mbed 2 deprecated LAB03_Oppgave1

Dependencies:   mbed

main.cpp

Committer:
madmonkeyman82
Date:
2015-09-10
Revision:
0:a7fe10523b91
Child:
1:b9d180275f1a

File content as of revision 0:a7fe10523b91:

#include "mbed.h"

BusOut Leds(PA_9,PC_7,PB_6,PA_7,PA_6,PA_5,PB_5,PB_4);
InterruptIn SW7(PB_3);

Timer timer1;

static int teller = 0;

void SW7_Pushed()
{
    teller++;    
    
}

int main() 
{
    
    SW7.fall(&SW7_Pushed);
    
    while (true) 
    {
        timer1.start();
        if(timer1.read_ms() == 500)
        {
            timer1.stop();
            timer1.reset();
            Leds = ~teller;
            teller = 0;
        }
      
    }
}