"Hi, does somebody have experienc..." <- > <@link445645:matrix.org> Hi, does somebody have experience with the MCP23017 GPIO expander? I am trying with the esp-hal and mcp230XX (with this PR to make it run with the embedded-hal 1.0.0 traits, https://github.com/quartiq/mcp230xx/pull/7). I tried a simple i2c scan loop over all adresses, which finds my device, so I think the pysical connection is ok. I get a panic > > !! A panic occured in 'src/main.rs', at line 36, column 45: > called `Result::unwrap()` on an `Err` value: AckCheckFailed > > ``` > let mut i2c0 = I2C::new( > peripherals.I2C0, > io.pins.gpio5, > io.pins.gpio4, > 100u32.kHz(), > &clocks, > None > ); > > let pin = Mcp23017::A7; > > pub const ADDR: u8 = 0x20; // default addr > > let mut u:Mcp230xx::, Mcp23017> = Mcp230xx::new(i2c0, ADDR).unwrap(); > u.set_direction(pin, Direction::Output).unwrap(); > u.set_gpio(pin, Level::High).unwrap(); > ``` > > ``` > mcp230xx = { git = "https://github.com/quartiq/mcp230xx.git", rev = "dcc66f4"} > esp-hal = { version = "0.18.0", features = [ "esp32c3" ] } > ``` after trying a lot of stuff, the problem apparently was the clock speed of the i2c bus. it works fine with 20khz, not with 100khz as taken from an tutorial online ðŸ«