 
   unsigned int sensor_count = 0;
   // Create analog temperature sensor
-  TemperatureSensor analog_sensor = default_sensor;
-  analog_sensor.address = 0;
-  analog_sensor.type = TYPE_ANALOG;
+  TemperatureSensor analog_sensor;
+  create_sensor(sensor_count, ANALOG_PIN, TYPE_ANALOG, &analog_sensor);
   sensors[sensor_count++] = analog_sensor;
 }
 

  sensor->curr_temp = celsius;
}

void setup()
{  
  nh.initNode();


#include <Wire.h>
#include <ros.h>
#include <std_msgs/String.h>

#define SENSOR_COUNT 1
#define TYPE_ANALOG 0
#define ANALOG_PIN 0

#define MAX_SAMPLE_RATE 10
#define MAX_SAMPLE_COUNT 10
#define MAX_DELTA 0.5

typedef struct temperature_sensor {
  unsigned int id;
  float prev_temp;
  float curr_temp;
  unsigned int type;
