Christian Weiß / Mbed 2 deprecated TINF_RunLight

Dependencies:   mbed

main.cpp

Committer:
Wizo
Date:
2018-11-15
Revision:
0:71c6b212eed9

File content as of revision 0:71c6b212eed9:

#include "mbed.h"

DigitalIn diUp(p15);
DigitalIn diDown(p12);

BusOut doLeds(LED1,LED2,LED3,LED4);

int main()
{
    doLeds = 0;
    while(1) {
        if (diDown) {
            if (doLeds <= 0)
                doLeds = 8;
            else
                doLeds = doLeds>>1; // um eine position nach rechts schieben
        } 
        else if (diUp){
            if (doLeds <= 0)
                doLeds = 1;
            else
                doLeds = doLeds<<1; // um eine position nach links schieben
        }
        if (doLeds != 0)
            wait(0.5);
    }
}