what output do you see with this code? (serial monitor at 115200 bauds)
#include <OneWire.h>
const byte ONE_WIRE_BUS = 10; // Pin connected to 1-Wire bus, add a 4.7K resistor as per datasheet
const byte EEPROM_READ_CMD = 0xF0; // Command to read from EEPROM
OneWire onewire(ONE_WIRE_BUS);
void setup() {
Serial.begin(115200);
byte data[32]; // Array to store EEPROM data
byte addr[8]; // Array to store sensor address
// Search for 1-Wire devices on the bus
if (!onewire.search(addr)) {
Serial.println("No more addresses.");
Serial.println();
onewire.reset_search();
delay(250);
return;
}
// Print the address of the detected sensor
Serial.print("Sensor Address: ");
for (byte i = 0; i < 8; i++) {
Serial.print(addr[i], HEX);
Serial.print(" ");
}
Serial.println();
// Reset the OneWire bus and select the sensor
onewire.reset();
onewire.select(addr);
// Send command to read EEPROM data
onewire.write(EEPROM_READ_CMD);
// Read data from EEPROM (32 bytes)
Serial.print("EEPROM Data: ");
for (byte i = 0; i < 32; i++) {
data[i] = onewire.read();
Serial.print(data[i], HEX);
Serial.print(" ");
}
Serial.println();
}
void loop() {}