![](/media/cache/profiles/30ba105754346aaf47509089d2287f2a.50x50_q85.png)
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
--- /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
--- /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
--- /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