Example program for LPC General Purpose Shield using LEDs

Dependencies:   PCAL955x mbed

main.cpp

Committer:
MACRUM
Date:
2015-07-27
Revision:
0:88bc691c83cb

File content as of revision 0:88bc691c83cb:

#include "mbed.h"
#include "PCAL9555.h"
 
PCAL9555    gpio_exp(SDA, SCL);
GpioBusOut  leds(gpio_exp, X1_4, X1_5, X1_6, X1_7);
 
enum key_num {
    OM13082_LD1 = (1 << 0),
    OM13082_LD2 = (1 << 1),
    OM13082_LD3 = (1 << 2),
    OM13082_LD4 = (1 << 3),
};
 
int main()
{
    while(1) {
        leds.write(0xF);
        wait(0.3);
        leds.write(~OM13082_LD1);
        wait(0.3);
        leds.write(~OM13082_LD2);
        wait(0.3);
        leds.write(~OM13082_LD3);
        wait(0.3);
        leds.write(~OM13082_LD4);
        wait(0.3);
    }
}