       // if 200ms have passed, check the battery level:
       if (currentMillis - previousMillis >= 200) {
         previousMillis = currentMillis;
-        updateTempLevel();
+        float newTemperature = readTemperature();
+        printTemperature(newTemperature);
+        updateTempLevel(newTemperature);
       }
     }
     // when the central disconnects, turn off the LED:

const int B=4275;                 // B value of the thermistor
const int R0 = 100000;            // R0 = 100k


void setup() {
  Serial.begin(9600);
  pinMode(4, OUTPUT);

  Serial.println("INit.");
  blePeripheral.setLocalName("TempMonitorSketch");
  blePeripheral.setAdvertisedServiceUuid(tempService.uuid());
  blePeripheral.addAttribute(tempService);
  blePeripheral.addAttribute(tempCharacteristic);
  tempCharacteristic.setValue(oldTemperature);

  /* Now activate the BLE device.  It will start continuously transmitting BLE
     advertising packets and will be visible to remote BLE central devices
     until it receives a new connection */
  blePeripheral.begin();
  Serial.println("Bluetooth device active, waiting for connections...");
}

void loop() {
  // listen for BLE peripherals to connect:
  BLECentral central = blePeripheral.central();

  Serial.println("Wait");
  // if a central is connected to peripheral:
  if (central) {
    Serial.print("Connected to central: ");
    // print the central's MAC address:
    Serial.println(central.address());
    // turn on the LED to indicate the connection:
    digitalWrite(4, HIGH);


    oldTemperature = temperature;
  }
}

void printTemperature(float temperature) {
  lcd.setCursor(0, 0);
  lcd.clear();
  lcd.print(temperature);
}
