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(12,"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
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
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:
Error:
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