Control Code with I/O and ADC working

Dependencies:   MODSERIAL mbed

Revision:
21:f87464a7e7c6
Parent:
20:cdeed4dad690
--- a/MCP23008/MCP23008.cpp	Mon Jul 16 03:53:59 2018 +0000
+++ b/MCP23008/MCP23008.cpp	Wed Jul 18 21:28:45 2018 +0000
@@ -28,7 +28,7 @@
     addrI2C = address;
 }
 
-void MCP23008::writeOutput(int chn1, int chn2, int chn3, int chn4){
+int MCP23008::writeOutput(int chn1, int chn2, int chn3, int chn4){
     char data[2];
     char data2[2];
     uint8_t val = 0x00;
@@ -45,8 +45,8 @@
     data2[1] = 0x00;
 
     i2c.write((addrI2C<<1)|(I2C_WRITE), data, 2);
-    i2c.write((addrI2C<<1)|(I2C_WRITE), data2, 2);
-    wait(0.02);
+    return i2c.write((addrI2C<<1)|(I2C_WRITE), data2, 2);
+    //wait(0.02);
 }
 
 void MCP23008::init(){