//1-Wire Device Address determination #include //1 #include const uint8_t ONE_WIRE_BUS = 14; //2 OneWire oneWire(ONE_WIRE_BUS); //3 DeviceAddress SensorAddress; //4 void setup() { Serial.begin(115200); //5 Serial.println("Searching for devices on the bus..."); oneWire.search(SensorAddress); //6 Serial.print("Device Address: "); printAddress(SensorAddress); //7 Serial.println("==========================="); Serial.println(); } void loop() { } void printAddress(DeviceAddress SensorAddress){ //8 for(uint8_t i=0; i<8;i++){ //9 Serial.print("0x"); //10 if(SensorAddress[i]<16) Serial.print("0"); //11 Serial.print(SensorAddress[i],HEX); //12 if(i<7) Serial.print(","); //13 } Serial.println(); }