I2C Issue #9727
-
I'm using an ESP32 S3 dev kit. I am trying to detect another device on I2C: from machine import I2C, Pin
i2c = I2C(0, Pin(0), Pin(1),freq=400000)
print(i2c)
print(i2c.scan()) # correct result is 56, or 0x38 This code results in an error:
Is my code not following the I2C prototype? If I try to use the defaults:
This does run, and it produces this output:
I expected to see |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Please have a look at the example in the documentation: https://docs.micropython.org/en/latest/esp32/quickref.html#hardware-i2c-bus
should be right and create output, if the wiring is for GND, 3.3V, SCL at Pin 0, SDA at Pin 1, and pull-up resistors are in place at SDA and SCL. |
Beta Was this translation helpful? Give feedback.
-
The ESP32 is very flexible, so long as you specify which pins are scl and sda you can use any available pins. And pull up resistors are essential though many I2C based modules include them. I routinely use ESP32 S3 kit with I2C with no problems. Do double check your wiring. |
Beta Was this translation helpful? Give feedback.
Please have a look at the example in the documentation: https://docs.micropython.org/en/latest/esp32/quickref.html#hardware-i2c-bus
The template:
should be right and create output, if the wiring is for GND, 3.3V, SCL at Pin 0, SDA at Pin 1, and pull-up resistors are in place at SDA and SCL.