 //////////
 // Dive //
 //////////
+
+void calculateMinMaxValues(float depthInMeter, float temperatureInCelsius)
+{
+	//Calculate minimum and maximum values during the dive
+	if (maxDepthInMeter < depthInMeter) {
+		maxDepthInMeter = depthInMeter;
+		view.drawMaximumDepth(maxDepthInMeter);
+	}
+	if (maxTemperatureInCelsius < temperatureInCelsius) {
+		maxTemperatureInCelsius = temperatureInCelsius;
+	}
+	if (minTemperatureInCelsius > temperatureInCelsius) {
+		minTemperatureInCelsius = temperatureInCelsius;
+	}
+}
 
 void diveSurface()
 {

	view.drawCurrentTemperature(temperatureInCelsius);
	view.drawCurrentPressure(pressureInMillibar);
	view.drawDepth(depthInMeter);
	view.drawDiveDuration(diveDurationInSeconds);

	//Calculate minimum and maximum values during the dive
	if (maxDepthInMeter < depthInMeter) {
		maxDepthInMeter = depthInMeter;
		view.drawMaximumDepth(maxDepthInMeter);
	}
	if (maxTemperatureInCelsius < temperatureInCelsius) {
		maxTemperatureInCelsius = temperatureInCelsius;
	}
	if (minTemperatureInCelsius > temperatureInCelsius) {
		minTemperatureInCelsius = temperatureInCelsius;
	}

	switch (currentScreen) {
		case GAUGE_SCREEN: {
			//Instead of dive information we will display the current time
			view.drawCurrentTime(getCurrentTimeText());
		}
		break;
		case DIVE_SCREEN: {

			//The timer fires in every second
			calculateSafetyStop(maxDepthInMeter, depthInMeter, 1);

			//Progress with the algorithm in every second
			diveProgress(temperatureInCelsius, pressureInMillibar, depthInMeter, diveDurationInSeconds);
		}
		break;
	}

	Wire.begin();         //Start the I2C interface
	irrecv.enableIRIn();  //Start the Infrared Receiver

    batteryMonitor.reset();
    batteryMonitor.quickStart();

