/*
 * @Author: dugulingping
 * @Date: 2022-05-27 03:22:20
 * @LastEditTime: 2022-05-27 03:58:45
 * @LastEditors: dugulingping
 * @Description: 
 * @FilePath: \test\iicAddress\iicAddress.ino
 */
#include <Wire.h>

/**

* SCL <--> D1

* SDA <--> D2

*/
//0x3C

void setup(){
    Wire.begin(4, 5);

    Serial.begin(9600);
    Serial.println("\nI2C Scanner");
}
void loop(){
    Serial.println("Scanning...");
    for(int address = 1; address < 127; address++){
        Wire.beginTransmission(address);
        byte code = Wire.endTransmission();
        if (code == 0) {
            Serial.print("Found: 0x");
            Serial.println(address, HEX);
        }
    }
    delay(5000);
}