-
-
-
Tổng tiền thanh toán:
-
Code test I2C cho ESP32
Đoàn Văn Huân
24/09/2026
Code test I2C cho ESP32
Dùng đoạn code Arduino IDE này để quét I2C trên ESP32. Với BNO086 của bạn: SDA = GPIO21, SCL = GPIO22.
#include <Wire.h>
#define SDA_PIN 21
#define SCL_PIN 22
void setup()
{
Serial.begin(115200);
delay(1000);
Serial.println();
Serial.println("=== ESP32 I2C SCANNER ===");
Wire.begin(SDA_PIN, SCL_PIN);
Wire.setClock(100000); // Test trước ở 100kHz
Serial.println("SDA = GPIO21");
Serial.println("SCL = GPIO22");
}
void loop()
{
byte ...