Chris Styles
/
EA_PCA9532_HelloWorld
Simple Hello World for the PCA9532 on the Embedded Artists Baseboard
Diff: main.cpp
- Revision:
- 1:bd3f6bfeebac
- Parent:
- 0:deb3f7947394
--- a/main.cpp Fri Apr 16 13:28:53 2010 +0000 +++ b/main.cpp Fri May 07 12:40:00 2010 +0000 @@ -1,20 +1,15 @@ #include "mbed.h" +#include "PCA9532.h" -I2C i2c (p28,p27); +PCA9532 leds (p28, p27, 0xc0); int main() { - char i2c_data[2]; + while (1) { + leds.SetLed(0xffff, MODE_ON); + wait (0.2); + leds.SetLed(0xffff, MODE_OFF); + wait (0.2); + } - while (1) { - i2c_data[0] = 6; // LS0 register - i2c_data[1] = 0x0; // all off - i2c.write(0xc0,i2c_data,2); - wait(0.2); - - i2c_data[0] = 6; // LS0 register - i2c_data[1] = 0x55; // all ON - i2c.write(0xc0,i2c_data,2); - wait(0.2); - } } \ No newline at end of file