You are reading a single comment by @consolenaut and its replies. Click here to read the full conversation.
  • Updating to 1v95 is a good shout, as is setting the address to 0 instead of 0x20, I've tried setting the address to 0 (along with 1 to 7 for make sure I'm not on the wrong address) but I'm still getting the same error unfortunately. I've just updated to 1v95 this moment and re-tested and I'm getting the same issue, full code is below, it's pulled almost verbatim from the example:

    Code:

    var i2c=I2C2;
    i2c.setup({scl: B10, sda: B3});
    var address = 0;
    var RST=A8;
    
    var port=require("MCP23017").connect(i2c,RST­,address);
    
    port.A0.mode('input_pullup');
    console.log(port.A0.read());
    

    Error:

    Uncaught InternalError: Timeout on I2C Write Transmit Mode 2
     at line 1 col 42
    this.i2c.writeTo(this.i2ca,c,[a&255,a>>8­])
                                             ^
    in function "s" called from line 1 col 128
    ...ut"==a?this.n&=~c:this.n|=c);this.s(1­2,"input_pullup"==a?thi...
                                  ^
    in function "m" called from line 1 col 18
    this.p.m(this.b,a)
                     ^
    in function "mode" called from line 1 col 28
    port.A0.mode('input_pullup');
                               ^
    Uncaught InternalError: Timeout on I2C Write Transmit Mode 2
     at line 1 col 29
    this.i2c.writeTo(this.i2ca,c);return this.i2c.readFrom(this....
                                ^
    in function "r" called from line 1 col 53
    ...8:this.b;return this.p.r(18)[255<this.b?1:0]&a?1:0
                                  ^
    in function "read" called from line 1 col 26
    console.log(port.A0.read());
    

    I've also attached a potato-quality photo of my wiring, note the reset pin is not connected - I've tried it both with and without, each result in the same error


    1 Attachment

    • image_uploaded_from_ios_720.png
About

Avatar for consolenaut @consolenaut started