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:
24:93e1474d6d8b
Parent:
20:e4572fc1b10d
Child:
25:ff73360cd038
--- a/settings.h	Thu May 25 11:31:47 2017 +0000
+++ b/settings.h	Thu May 25 11:57:26 2017 +0000
@@ -1,4 +1,53 @@
-
+int setting_press(){
+    int x = readX();
+    int y = readY();
+    if (touching == 1) {
+        if (x > 0 && x < 50 && y > 0 & y < 100) // side button 1 (set)
+        {
+            //set desired state to 1 
+            return 1;
+        }
+        else if (x > 0 && x < 50 && y > 100 & y < 200) //side button 2 (cancel)
+        {
+            //set desired state to 2 
+            return 2;
+        }
+        else if (x > 0 && x < 50 && y > 200 && y < 240) // button home
+        {
+            //set desired state to 0
+            return 0;
+        }
+        else if (x > 50 && x < 185 && y > 0 && y < 100) // Alarm Hour 
+        {
+            return 11;
+        }
+        else if (x > 185 && x < 320 && y >  0 && y < 100) // Alarm Min
+        {
+            return 12;
+        }
+        else if (x > 50 && x < 185 && y >  100 && y < 200) //Time Hour
+        {
+            return 13;
+        }
+        else if (x > 185 && x < 320 && y >  100 && y < 200)//Time Min
+        {
+            return 14;
+        }
+        else if (x > 50 && x < 140 && y >  200 && y < 300)//Time Date      
+        {
+            return 15;
+        }
+        else if (x > 140 && x < 230 && y >  200 && y < 300)//Time Month
+        {
+            return 16;
+        }
+        else if (x > 230 && x < 320 && y >  200 && y < 300) //Time Year
+        {
+            return 17;
+        }       
+    }
+    return -1;
+}
 
 void drawsettingback() //Navigation Buttons
 {
@@ -95,6 +144,6 @@
 
     
 }
-void settingslogic() {
+void settings() {
     
     }
\ No newline at end of file