A Weather station designed to read the values of temperature and pressure from the sensor (BMP180), data displayed via a nokia N5110 display.

Dependencies:   BMP180 N5110 PowerControl mbed

Revision:
24:51cbed3fbf5c
Parent:
23:a0ce9fa869c2
Child:
25:fa65a9cc78f0
--- a/Barometer.cpp	Sat May 09 01:08:16 2015 +0000
+++ b/Barometer.cpp	Sat May 09 01:24:06 2015 +0000
@@ -82,9 +82,6 @@
     //serial.printf("Unix date :%i \n",UNIXdate);
     strftime(bufferTime, 14 , "%H:%M", localtime(&seconds));
     strftime(bufferDate, 14 , "%d/%m/%y", localtime(&seconds));
-    if (alarmClockFlag == 1 ) { // if the the alarm clock flag is set by the user
-        alarmClockCheck();
-    }
 }
 
 
@@ -140,13 +137,6 @@
         // it is important the format specifier ensures the length will fit in the buffer
     }
 
-    if (thresholdAlarmFlag == 1) { // if the flag is set by the user to notify the thresholds
-        serial.printf("thresholds flag checked = 1\n");
-        serial.printf("real values: t %i p %f \n",temperature,pressure);
-        serial.printf("thresholds: mint%i maxt%i minP%i maxP %i \n",fsmH[0].output,fsmH[1].output,fsmH[2].output,fsmH[3].output);
-        thresholdCheck();
-    }
-
 }
 
 
@@ -168,7 +158,6 @@
 {
     if (powerSaverFlag == 1) {
         while (1) {
-            thresholdCheck();
             alarmClockCheck();
             updateTime();
             loggerData();
@@ -197,7 +186,6 @@
     timerFlag=1;
     timer.attach(&timerExpired,1.0);
     while (1) {
-        thresholdCheck();
         alarmClockCheck();
         powerSaverCheck();
         updateTime();
@@ -207,6 +195,7 @@
             yellowLED = 1;
             timerFlag=0;
             readData();
+            thresholdCheck();
             strncpy(buffer1, bufferTime, 14);
             strncpy(buffer2, bufferDate, 14);
             strncpy(buffer3, bufferT, 14);
@@ -237,7 +226,7 @@
         int sumPressure = 0;
         greenLED = 1;
         readData();
-
+        thresholdCheck();
         dataLoggerFlag=0;
 //write the data to the arrays (arrays used to plot graphs)
         //read the data from sensor
@@ -391,7 +380,6 @@
 {
     int swipe = 1 ;
     while (1) {
-        thresholdCheck();
         alarmClockCheck();
         powerSaverCheck();
         updateTime();
@@ -719,7 +707,6 @@
 {
     state = 0;
     while (1) {
-        thresholdCheck();
         alarmClockCheck();
         powerSaverCheck();
         updateTime();
@@ -825,7 +812,6 @@
 {
     state = 0 ;
     while (1) {
-        thresholdCheck();
         alarmClockCheck();
         powerSaverCheck();
         updateTime();
@@ -880,7 +866,6 @@
 {
     state = runLoggerFlag ; //inits the state to the saved flag by the user in the past
     while (1) {
-        thresholdCheck();
         alarmClockCheck();
         powerSaverCheck();
         updateTime();
@@ -958,7 +943,6 @@
 
     state = powerSaverFlag ; //inits the state to the saved flag by the user in the past
     while (1) {
-        thresholdCheck();
         alarmClockCheck();
         powerSaverCheck();
         updateTime();
@@ -1053,7 +1037,6 @@
     state = 0;
     powerSaverCheck();
     while (1) {
-        thresholdCheck();
         alarmClockCheck();
         updateTime();
         loggerData();
@@ -1099,7 +1082,6 @@
 
     state = 0;
     while (1) {
-        thresholdCheck();
         alarmClockCheck();
         powerSaverCheck();
         updateTime();
@@ -1167,7 +1149,7 @@
 {
     state = 0;
     while(button3Flag==0) {
-
+               alarmClockCheck();
         powerSaverCheck();
         updateTime();
         loggerData();
@@ -1237,7 +1219,6 @@
 {
     while(1) {
         updateTime();
-        thresholdCheck();
         alarmClockCheck();
         powerSaverCheck();
         loggerData();