#include #include // Data wire is connected to GPIO pin 27 #define ONE_WIRE_BUS 27 OneWire oneWire(ONE_WIRE_BUS); DallasTemperature sensors(&oneWire); void setup() { Serial.begin(9600); sensors.begin(); } void loop() { sensors.requestTemperatures(); float temperatureC = sensors.getTempCByIndex(0); Serial.print("Temperature: "); Serial.print(temperatureC); Serial.println(" °C"); delay(1000); // Wait for 1 second before the next reading }