Page 20 - Assessment No 1- 257
P. 20

Serial.print("Atmospheric pressure: ");    // Prints atmospheric

               pressure to serial monitor.

                 Serial.print(atmPressure,2);


                 Serial.println(" millibar.");




                 Serial.print("Altitude: ");                // Prints altitude to serial monitor.


                 Serial.print(altitude,1);


                 Serial.println(" meter.");




                 delay(1000);    // 1 second delay between measurements.


               }







               float readAtmPressure()     // Function that will read the atmospheric
               pressure.


               {


                 char status;

                 float Temp,Pres;





                 status = pressure.startTemperature();    // Library function that starts
               temperature measurement procedure.


                 if (status != 0)
   15   16   17   18   19   20   21   22   23   24   25