Successfully Added To Cart

EXERCISE SOLUTIONS:

Question 1

BMP180 measures temperature to 0.5°. DHT11 measures temperature to 1.0°. Therefore, BMP180 is more accurate at measuring temperature.

Question 2

Add this code to the end of the printWeatherData function:

if (units == 'm') {
if (temperature > 25) {
Serial.println ("Warning: Temperature is above 25 degrees Celsius!");
}
}

else if (units == 'i') {
if (temperature > 77) {
Serial.println ("Warning: Temperature is above 77 degrees Farenheit!");
}
}

Question 3

Change this section of the code:

if ((seaLevelPressure >= 90 ) && (seaLevelPressure <= 110)) {
Serial.println("Sea level pressure entered is: ");
Serial.print(seaLevelPressure, 3);
Serial.print(" kPa\n");
Serial.print((seaLevelPressure*1000), 3);
Serial.print(" Pa\n");
Serial.print((seaLevelPressure*10), 3);
Serial.print(" hPa\n");
Serial.print((seaLevelPressure*10), 3);
Serial.print(" mBar\n");
break;
}

Bonus Question

Download the code above (the 'I Give Up' file) for the solution to this question.