#include <Wire.h>

static const int SDA_PIN = 5;
static const int SCL_PIN = 4;

void setup() {
  Serial.begin(115200);
  delay(300);

  Wire.begin(SDA_PIN, SCL_PIN);
  Wire.setClock(100000);

  pinMode(SDA_PIN, INPUT_PULLUP);
  pinMode(SCL_PIN, INPUT_PULLUP);

  Serial.printf("SDA=%d reads %d | SCL=%d reads %d\n",
                SDA_PIN, digitalRead(SDA_PIN),
                SCL_PIN, digitalRead(SCL_PIN));

  Serial.println("Scanning...");
  int found = 0;
  for (uint8_t addr = 1; addr < 127; addr++) {
    Wire.beginTransmission(addr);
    uint8_t err = Wire.endTransmission();
    if (err == 0) {
      Serial.printf("Found 0x%02X\n", addr);
      found++;
    }
  }
  Serial.printf("Done. Found %d device(s)\n", found);
}

void loop() {}
