Problem with I2C pin

bizyroth
Posts: 1
Joined: Fri Jul 28, 2017 10:46 am

Problem with I2C pin

Postby bizyroth » Fri Jul 28, 2017 11:04 am

Hello,

I'm trying to test the program of Kolban with the BMP180 and a esp WROOM 32:
https://github.com/nkolban/esp32-snippe ... 20pressure

I connect SCL pin of the BMP180 to GPIO23 pin of the esp32 and the SDA pin to the io22. However, the output temperature is constant equal to 12.9°C and when i disconnect the bmp180 the temperature doesn't change.

In bmp180.c pin number are initialized with:

Code: Select all

	conf.sda_io_num = 18;
		conf.scl_io_num = 19;
But in the esp WROOM 32 datasheet, the schema with the pin layout said that GPIO22 pin number is 36 and GPIO23 pin number is 37.

Wich number should i precise in the bmp180.c?

Thank you

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: Problem with I2C pin

Postby kolban » Fri Jul 28, 2017 2:49 pm

In the ESP32 almost all pins can be used for almost any function. In that sample GPIO 18 was used as the I2C SDA line while GPIO 19 was used as the I2C CLK line. You can change those pins as desired. Unlike other devices, the ESP32 doesn't constrain specific pins to specific purposes ... so there aren't dedicate pins for I2C, SPI or other functions.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

Who is online

Users browsing this forum: Google [Bot] and 58 guests