IoT Ox / Mbed 2 deprecated MainSketch Featured

Dependencies:   RTC-DS1307 SPI_TFT_ILI9341 TFT_fonts mbed tsi_sensor

Fork of TFT_Mikroelectronika_IL9341_sketchpad by Oxford CWM Team

Revision:
48:76ac309a2bd9
Parent:
44:1c516642c34e
--- a/analoglogic.h	Fri May 26 08:45:43 2017 +0000
+++ b/analoglogic.h	Fri May 26 09:34:38 2017 +0000
@@ -23,8 +23,9 @@
         else if (x > 0 && x < 50 && y > 150 && y < 200) // side button 4 
         {
             //set desired state to 4
-           // f_cycle = !f_cycle;
-           return 4;
+            f_cycle = !f_cycle;
+            f_cycle_secs = tm_c.sec;
+          // return 4;
             
         }else if (x > 0 && x < 50 && y > 200 && y < 240) // button home
         {
@@ -109,8 +110,10 @@
         TFT.locate(220,210);    
         TFT.printf("%d",tm_c.year);     */
         if (f_cycle){
+            if ((f_cycle_secs + f_cycle_wait) == tm_c.sec){
             f_state = 1;
-            wait(1);
+            f_cycle_secs = tm_c.sec;
+            }
         }
         switch (ana_clock_press()){
             case (-1): break;