 {  
   nh.initNode();
   nh.advertise(pub_temp);
+  nh.subscribe(sub_temp);
 
   unsigned int sensor_count = 0;
   // Create analog temperature sensor

   }
}

static void handle_temp(TemperatureSensor* sensor) {
  if(abs(sensor->prev_temp - sensor->curr_temp) > MAX_DELTA) {
    sensor->prev_temp = sensor->curr_temp;
    String message = json_prefix + sensor->id + json_middle + sensor->curr_temp + json_suffix;
    temp_msg.data = message.c_str();
    pub_temp.publish(&temp_msg);
  }
}


#include <Wire.h>
#include <ros.h>
#include <std_msgs/String.h>
#include <std_msgs/UInt8.h>
#include <OneWire.h>
#include <DallasTemperature.h>

#define SENSOR_COUNT 6
#define TYPE_ANALOG 0
#define ANALOG_PIN 0

