So I am struggling with I2C…
I have a perf board all soldered up and can’t get the particle to talk with an MCP23017. I did test it in the Bus Pirate and can get the LEDs to turn on. I did use some pull resistors (4.7k) on the lines and described in the Docs. Here’s my code:
void setup(){
Serial.begin(9600);
Serial.println(String(“Initiated”));
Wire.setSpeed(CLOCK_SPEED_400KHZ);
Wire.begin(byte(0x20));
Wire.beginTransmission(byte(0x20));
Wire.write(byte(0x00));
Wire.write(byte(0x00));
Wire.endTransmission();
delay(500);
Wire.beginTransmission(byte(0x20));
Wire.write(byte(0x01));
Wire.write(0x00);
Wire.endTransmission();
}
void loop(){
Wire.beginTransmission(byte(0x20));
Wire.write(0x13);
Wire.write(0xF0);
Wire.endTransmission();
delay(1000);
Wire.beginTransmission(0x20);
Wire.write(0x13);
Wire.write(0x00);
Wire.endTransmission();
delay(1000);
}