#include #include // Data wire is plugged into pin 2 on the Arduino #define SN 21 // Setup a oneWire instance to communicate with any OneWire devices // (not just Maxim/Dallas temperature ICs) OneWire oneWire(2); // Pass our oneWire reference to Dallas Temperature. DallasTemperature sensors(&oneWire); void setup(void) { Serial.begin(9600); Serial.println("serial:init;"); sensors.begin(); } void loop(void) { sensors.requestTemperatures(); Serial.print("type:DALLAS,"); Serial.print("ser:"); Serial.print(SN); Serial.print(","); Serial.print("temp:"); Serial.print(sensors.getTempCByIndex(0)); Serial.println(";"); }