Dependencies:   mbed

main.cpp

Committer:
anti2810
Date:
2015-03-16
Revision:
0:80878bdaa4b2

File content as of revision 0:80878bdaa4b2:

#include "mbed.h"

BusOut ledbar(P1_13,P1_12,P1_7,P1_6,P1_4,P1_3,P1_1,P1_0,LED4,LED3,LED2,LED1);

InterruptIn sw1(P0_15);

void Lauflicht();

void Sw1ISR()
{
    if(sw1.read())
    Lauflicht();
}

void main()
{
    ledbar=1;
    sw1.rise(&Sw1ISR);
    while(1)  {
    }
}

void Lauflicht()
{
    if(ledbar==2048 )
    ledbar=1;
    else
    ledbar=ledbar<<1;
}