 
   
 }
+
+
 // please customize the how to get the sensor data and store to sensorValue[]
 int get_sensor_data(){
   

      Serial.print("SensorValue(Barometer):");
      Serial.println(sensorValue[SENSOR_ID_BAROMETER]);

      float h,t;
      dht.readHT(&t, &h);
      while (isnan(t) || isnan(h) || t<0 || t>80 || h<0 || h > 100){
        Serial.println("Something wrong with DHT => retry it!");
        delay(100);
        dht.readHT(&t, &h);    
      }
      sensorValue[SENSOR_ID_TEMPERATURE] = t;
      Serial.print("SensorValue(Temperature):");
      Serial.println(sensorValue[SENSOR_ID_TEMPERATURE]);

    sensorUploadString[0]=0;
    Serial.println("Sensor string overflow!");
  }
}

boolean createThread(void* userdata) { 
  // The priority can be 1 - 255 and default priority are 0 
  // the arduino priority are 245 
  vm_thread_create(test_thread, NULL, 255); 
  return true; 
} 

// This is the thread it self 
VMINT32 test_thread(VM_THREAD_HANDLE thread_handle, void* user_data) 
{ 
      dht.readHT(&t, &h);
      while (isnan(t) || isnan(h) || t<0 || t>80 || h<0 || h > 100){
        Serial.println("Something wrong with DHT => retry it!");
        delay(100);
        dht.readHT(&t, &h);   
      }
      ThreadComplete=true;
}


