 
 void loop() {
   if (readyForWeatherUpdate && display.getFrameState() == display.FRAME_STATE_FIX) {
+    gettemperature();       // read sensor  
+
+    
     readyForWeatherUpdate = false;
-    weather.setUnits("si");
-    weather.updateWeatherData(forecastApiKey, latitude, longitude);  
+    weather.setUnits("us");
+    weather.updateWeatherData(forecastApiKey, latitude, longitude);
+
+    
   }
   display.clear();
   display.nextFrameTick();

  return cloudy_bits;
}

void drawFrame2(int x, int y) {
   display.setFontScale2x2(false);
   display.drawString(65 + x, 0 + y, "Today");
   display.drawXbm(x,y, 60, 60, xbmtemp);
   display.setFontScale2x2(true);
   display.drawString(64 + x, 14 + y, String(weather.getCurrentTemp()) + "C");
   display.setFontScale2x2(false);
   display.drawString(66 + x, 40 + y, String(weather.getMinTempToday()) + "C/" + String(weather.getMaxTempToday()) + "C");  

}

void drawFrame3(int x, int y) {
   display.drawXbm(x+7,y+7, 50, 50, getIconFromString(weather.getIconTomorrow()));
   display.setFontScale2x2(false);
   display.drawString(65 + x, 7 + y, "Tomorrow");
   display.setFontScale2x2(true);
   display.drawString(64+ x, 20 + y, String(weather.getMaxTempTomorrow()) + "C");     
}

void drawSpinner(int count, int active) {

  }   
}


void gettemperature() {
  // Wait at least 2 seconds seconds between measurements.
  // if the difference between the current time and last time you read
  // the sensor is bigger than the interval you set, read the sensor
  // Works better than delay for things happening elsewhere also
  unsigned long currentMillis = millis();
 
  if(currentMillis - previousMillis >= interval) {
    // save the last time you read the sensor 
    previousMillis = currentMillis;   

    // Reading temperature for humidity takes about 250 milliseconds!
    // Sensor readings may also be up to 2 seconds 'old' (it's a very slow sensor)
    humidity = dht.readHumidity();          // Read humidity (percent)
    temp_f = dht.readTemperature(true);     // Read temperature as Fahrenheit
    // Check if any reads failed and exit early (to try again).
    if (isnan(humidity) || isnan(temp_f)) {
      Serial.println("Failed to read from DHT sensor!");
      return;
    }
  }
}

