Was looking to do a project with the ADXL345 via I2C to the ESP12E and ESP32. Arduino board has two pins named SCL and SDA, but do not see that on the ESP boards. Do these boards support I2C?
Hi Kevin.
The hardware I2C pins for the ESP32 are GPIO 22 (SCL) and GPIO 21 (SDA). The pins with a blue rectangle in the figure below. However, you can set almost any pin as I2C via software.
To learn more about I2C with the ESP32, read our guide: ESP32 I2C Communication: Set Pins, Multiple Bus Interfaces and Peripherals (Arduino IDE)
For the ESP 12E, the pins often used for I2C are GPIO 5 (SCL) and GPIO 4 (SDA).
Regards,
Sara
Thanks!! I somehow missed these when I looked at this diagram in your book, which is fantastic by the way. Thanks for pointing this out. The diagram of the ESP-12E (in an earlier book/tutorial) did not show GIO 5(SCL) but I had seen something else on the web that suggested that these pins (D1/D2) supported i2c. Thanks for confirming!!!