Hey guys and gals, I have a MCP23017 and I'm using Jim Herd's library found Here. I am using the following code:
#include "mbed.h"
#include "MCP23017.h"
DigitalOut myled1(LED1);
DigitalOut myled2(LED2);
DigitalOut myled3(LED3);
//I2C i2cX( p9, p10);
MCP23017 *xController;
int main() {
xController = new MCP23017( p9, p10, 0x00);
// I2C init
//i2cX.frequency(100000);
xController->config(0,0,0);
myled3 = 1;
wait(1);
myled3 = 0;
int x;
while(1) {
myled1 = 1;
myled2 = 0;
for (x = 0; x < 16; x++){
xController->write_bit(0,x);
}
wait(1);
myled1 = 0;
myled2 = 1;
for (x = 0; x < 16; x++){
xController->write_bit(1,x);
}
wait(1);
}
}
For data connections, I have sda to pin 9, scl to pin 10, 3.3k pullup to 3.3V from both data lines, Vss / A0/A1/A2 to GND, Vdd to +3.3V. What am I missing here to get this working? The values of all the pins are 0.08V and that doesn't change.
I'm on a short deadline so anything to get me started or fix it I'd really appreciate it.
EDIT:: I don't believe I make my own I2C variable, _i2c is in the library
Hey guys and gals, I have a MCP23017 and I'm using Jim Herd's library found Here. I am using the following code:
For data connections, I have sda to pin 9, scl to pin 10, 3.3k pullup to 3.3V from both data lines, Vss / A0/A1/A2 to GND, Vdd to +3.3V. What am I missing here to get this working? The values of all the pins are 0.08V and that doesn't change.
I'm on a short deadline so anything to get me started or fix it I'd really appreciate it.
EDIT:: I don't believe I make my own I2C variable, _i2c is in the library