 
 double c2f(double c){
   return c * 1.8 + 32.0;
+}
+
+double abs_d(double x){
+  if (x < 0) return x * -1;
+
+  return x;
 }
 
 void loop()


    Serial.println("Main> Initializing... ");

    led.init();
    led.disable();
    led.setColor(YELLOW);

    Serial.print("Main> My device id: ");
    Serial.println(myDeviceId);

    // If the temp has not changed (+/- .5 degrees) no need to send the data
    // However, if the counter reaches 10, then send the data anyway
    // to notify the server that you are still alive :)
    double diff = currentTempC - celcius;
    if (abs_d(diff) > .5 || counter > TEMP_LOOP_CNT_THRESHOLD) {
      led.setColor(BLUE);
      Serial.print("Main> Sending current temp data to server.");
      Serial.printlnf("Previous temp: %f C, Current temp: %f C", currentTempC, celcius);
      currentTempC = celcius;
      if (! client.SendTemperatureData(celcius, fahrenheit)) {
        Serial.println("Main> Failed to send data to server, will try again next time");
      }
