Test application for the library MCP23017_I2C
Dependencies: DebugLibrary MCP23017_I2C mbed
Revision 2:83b9df729e73, committed 2015-01-09
- Comitter:
- Yann
- Date:
- Fri Jan 09 15:36:08 2015 +0000
- Parent:
- 1:e981573db063
- Child:
- 3:3f23faf5f7eb
- Commit message:
- Bug fixed in read method; Add bus support
Changed in this revision
| MCP23017_I2C.lib | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/MCP23017_I2C.lib Fri Jan 09 14:37:46 2015 +0000 +++ b/MCP23017_I2C.lib Fri Jan 09 15:36:08 2015 +0000 @@ -1,1 +1,1 @@ -MCP23017_I2C#ebd3a7cc9b92 +MCP23017_I2C#ec9e770173d5
--- a/main.cpp Fri Jan 09 14:37:46 2015 +0000
+++ b/main.cpp Fri Jan 09 15:36:08 2015 +0000
@@ -49,6 +49,17 @@
case 'h':
g_gpioExp.write(GPB7, 0);
break;
+ case 'i': {
+ std::list<unsigned char> lcdBus;
+ lcdBus.push_back(GPA7);
+ lcdBus.push_back(GPA6);
+ lcdBus.push_back(GPA5);
+ lcdBus.push_back(GPA4);
+ unsigned char busId = g_gpioExp.createBus(lcdBus);
+ g_gpioExp.busWrite(busId, 0x000A); // GPA7=1, GPA6=0, GPA5=1, GPA4=0
+ g_gpioExp.deleteBus(busId);
+ }
+ break;
case 'r':
g_gpioExp.reset();
break;
Yann Garcia