Chris Styles
/
EA_PCA9532_HelloWorld
Simple Hello World for the PCA9532 on the Embedded Artists Baseboard
Diff: main.cpp
- Revision:
- 0:deb3f7947394
- Child:
- 1:bd3f6bfeebac
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Apr 16 13:28:53 2010 +0000 @@ -0,0 +1,20 @@ +#include "mbed.h" + +I2C i2c (p28,p27); + +int main() { + + char i2c_data[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