LEDs gehen an wenn Taster gedrückt

Dependencies:   mbed

main.cpp

Committer:
mSeiser
Date:
2015-04-24
Revision:
0:bb5edc977ef2

File content as of revision 0:bb5edc977ef2:

#include "mbed.h"
#include "ur_Bertl.h"
#include "const.h"




int main()
{
    
    ur_Bertl karel;
    
    while(1)
    {
        if(karel.IsButtonPressed(BTN_FLL))          //linker Button vorne außen
            karel.TurnLedOn(0x01);
        if(karel.IsButtonPressed(BTN_FRR))          //rechter Button vorne außen
            karel.TurnLedOn(0x04);
        if(karel.IsButtonPressed(BTN_FRR)&&karel.IsButtonPressed(BTN_FLL))
            karel.TurnLedOn(0x0F);
        if(karel.IsButtonPressed(BTN_BR))           //linker Button hinten außen
            karel.TurnLedOn(0x80);
        if(karel.IsButtonPressed(BTN_BL))           //rechter Button hinten außen
            karel.TurnLedOn(0x20);
        if(karel.IsButtonPressed(BTN_BR)&&(karel.IsButtonPressed(BTN_BL))) 
            karel.TurnLedOn(0xF0); 
    }
    
    
}