Example PCA9538 I2C Expander
Dependencies: mbed PCA9538_Expander
Revision 0:b1f14a61b440, committed 2011-02-02
- Comitter:
- Suky
- Date:
- Wed Feb 02 21:20:49 2011 +0000
- Commit message:
Changed in this revision
diff -r 000000000000 -r b1f14a61b440 PCA9538_Expander.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PCA9538_Expander.lib Wed Feb 02 21:20:49 2011 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/Suky/code/PCA9538_Expander/#d0e0b38e5991
diff -r 000000000000 -r b1f14a61b440 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Feb 02 21:20:49 2011 +0000 @@ -0,0 +1,39 @@ +#include "mbed.h" +#include "PCA9538.h" + +//PCA9538 MyExpand(p9,p10,0x70,p21); +DigitalOut myled(LED1); +DigitalOut myled2(LED2); +PCA9538PinOut myled3(exp_p4,p9,p10,0x70); +PCA9538PinOut myled4(exp_p7,p9,p10,0x70); +PCA9538PinIn mypuls(exp_p0,p9,p10,0x70); +//void vISRExpand(void); + +int main() { + //MyExpand.vInit(0x0F,&vISRExpand); + //MyExpand.vWrite(0x00); + while(1) { + if(mypuls==0){ + myled2=1; + wait(0.3); + myled2=0; + wait(0.3); + }else{ + myled3=1; + myled4=1; + myled=myled3; + wait(0.5); + myled = 0; + myled3=0; + myled4=0; + wait(0.5); + } + } +} + + +/*void vISRExpand(void){ + + myled2=!myled2; + MyExpand.vWrite(MyExpand.cRead()<<4); +}*/ \ No newline at end of file
diff -r 000000000000 -r b1f14a61b440 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Feb 02 21:20:49 2011 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/9a9732ce53a1