![](/media/cache/profiles/9bd5ee6fe55aaeb673025dbcb8f939c1.50x50_q85.jpg)
Example program for LPC General Purpose Shield using LEDs
Diff: main.cpp
- Revision:
- 0:88bc691c83cb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Jul 27 08:52:54 2015 +0000 @@ -0,0 +1,29 @@ +#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); + } +} + \ No newline at end of file