coursework

Revision:
2:54c537a2569a
Parent:
1:dc648c5624b9
--- a/sensor_data.h	Wed Jan 10 09:50:29 2018 +0000
+++ b/sensor_data.h	Fri Jan 26 13:20:05 2018 +0000
@@ -3,9 +3,9 @@
 #include "calender_operation.h"
 float getTemperature_bmp280; // Read the current Temperature  value  from BME280 sensor
 float getPressure_bmp280; // Read the current humidity value (humidity %) from BME280 sensor
-float fLDR;                // Read the current light intensity value from LDR sensor
+float fLDR =0.0;                // Read the current light intensity value from LDR sensor
 float temperature_data [120], pressure_data[120], LDR_data[120];
-BMP280 bmp280(D14,D15,0x77);  //Assigning the pin for BMP280 Pressure sensor
+BMP280 bmp(D14,D15,0x76);  //Assigning the pin for BMP280 Pressure sensor
  
 AnalogIn LDR(A1);         //Assigning the pin for LDR 
 int counter_store = 0, full = 0, day, month, year, leap;
@@ -150,22 +150,22 @@
 //Sensor setup  
 void sensor_operation()
 {
-    getTemperature_bmp280 = bmp280.getTemperature();
+    getTemperature_bmp280 = bmp.getTemperature();
     
-    getPressure_bmp280 = bmp280.getPressure();    
+    getPressure_bmp280 = bmp.getPressure();    
     fLDR = LDR;
 }
 //******* Displaying sensor data to the lcd to allocated position ************* 
 void sensor_lcd()
 {
-        lcd.locate(10,0);
+        lcd.locate(0,0);
         lcd.printf("L:%1.2f", fLDR);
         
-        lcd.locate(0,0);
+        lcd.locate(8,0);
         lcd.printf("P:%3.1f", getPressure_bmp280);
         
-        lcd.locate(10,1);
-        lcd.printf("T:%3.1f", getTemperature_bmp280);
+        lcd.locate(9,1);
+        lcd.printf("T:%5.1f", getTemperature_bmp280);
     }
 void records() 
 {