g

Dependencies:   mbed

leds2.cpp

Committer:
fatima365
Date:
2019-12-05
Revision:
1:210e74bbbe34

File content as of revision 1:210e74bbbe34:

#include "mbed.h"

//        LSB                           MSB
//        2^0 2^1 2^2 2^3               2^7
BusOut lb(D2, D3, D6, D9, D11, D12, A6, D13);

void main() 
{   
    while(1)
    {
        BitsSetzen();    
    }
}

void BitsSetzen()
{
    lb = 1; // B#0001   D2 leuchtet
    wait_ms(500);
    lb = 2; // B#0010   D3 leuchtet
    wait_ms(500);
    lb = 3; // B#0011   D2 und D3 leuchten
    wait_ms(500);
    lb = 4; // B#0100   D6 leuchtet
    wait_ms(500);
    lb = 8; // B#1000   D9 leuchtet    
}