-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configure the pins for I2C #18
Comments
I ran into the same issue and managed to make it work like this: #include <Wire.h>
#define I2C_SDA 33
#define I2C_SCL 32
void setup() {
Wire.begin(I2C_SDA, I2C_SCL);
} Here the full example for reading a BME280: #include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
#define I2C_SDA 33
#define I2C_SCL 32
Adafruit_BME280 bme;
void setup() {
Wire.begin(I2C_SDA, I2C_SCL);
Serial.begin(9600);
// while (!Serial);
if (!bme.begin(0x76)) {
Serial.println("Error, check I2c address and wiring!");
while (1);
}
}
void loop() {
Serial.print("Temp:");
Serial.print(bme.readTemperature());
Serial.println("*C");
Serial.print("Pressure:");
Serial.print(bme.readPressure() / 100.0F);
Serial.println("hPa");
Serial.print("Humidity:");
Serial.print(bme.readHumidity());
Serial.println("%");
Serial.println();
delay(1000);
} |
How do you physically connect to pin 32 and 33? soldering directly to the ESP32 board on the T-relay board? I also tried to scan with common I2C scanner code, after connecting to pin 14 and 25, without success, no device found. |
SOLVED for me! Wire.begin(26, 14); so pinout for I2C on T-relay 8X is SDA: pin 26 |
Hi, We are use it T_Relay4_ESP32 with I2C. In our development is IDF. we set it as pin into SDA - 26, SCL - 14. But Not Working as to LCD Display. Please Give me solution. In our code reference is https://esp32tutorials.com/i2c-lcd-esp32-esp-idf/ |
In my case on the T_Relay4 it was SDA 33 SCL 32. Maybe the T-Relay 8x is using other pins. you should give it a try. |
Hello everybody,
I need to configure I2C, and I can't do it using the wire.begin(26, 14) method. Can someone explain to me how I configure the pins for I2C
The text was updated successfully, but these errors were encountered: