Contains the main execution of the clock uses headers to import functions

Dependencies:   RTC-DS1307 SPI_TFT_ILI9341 TFT_fonts mbed tsi_sensor

Fork of TFT_Mikroelectronika_IL9341_sketchpad by Oxford CWM Team

Revision:
39:4b70d28cb273
Parent:
38:3fe3bafbf0c7
Child:
48:76ac309a2bd9
--- a/drawStates.h	Thu May 25 19:54:51 2017 +0000
+++ b/drawStates.h	Fri May 26 08:28:27 2017 +0000
@@ -2,31 +2,31 @@
 
 void draw_state(int i)
 {
-    TFT.cls();
+    TFT.cls(); // clear screen
     switch (i) {
-        case (1):
+        case (1): // interface 1 : digital clock 
             //buttons
-            TFT.fillrect(0, 0, 50, 50, Red);
+            TFT.fillrect(0, 0, 50, 50, Red);  //first button for digital to analog interface change
             TFT.background(Red);
             TFT.locate(2,5);
             TFT.set_font((unsigned char*) Arial12x12);
             TFT.printf("Dig/\n\rALog");
-            TFT.fillrect(0, 50, 50, 100, Green);
+            TFT.fillrect(0, 50, 50, 100, Green); //second button for settings page
             TFT.background(Green);
             TFT.locate(2, 55);
             TFT.printf("Set\n\rTime");
-            TFT.fillrect(0, 100, 50, 150, Blue);
+            TFT.fillrect(0, 100, 50, 150, Blue); //third button for whiteboard
             TFT.background(Blue);
             TFT.locate(2, 105);
             TFT.printf("Draw");
             TFT.background(White);
-            TFT.fillrect(0, 150, 50, 200, White);
+            TFT.fillrect(0, 150, 50, 200, White); //last button for pong game
             TFT.foreground(Black);
             TFT.locate(2,155);
             TFT.printf("Pong");
             TFT.background(Black);
             TFT.foreground(White);
-            TFT.fillrect(0, 200, 50, 240, Black);
+            TFT.fillrect(0, 200, 50, 240, Black); //home button to reset
             TFT.locate(2, 205);
             TFT.printf("Home");
 
@@ -56,8 +56,8 @@
             TFT.fillcircle(tx, ty - 10, 2, White);
             TFT.fillcircle(tx, ty + 10, 2, White);
             break;
-        case (2):
-            //buttons
+        case (2): // analog clock interface
+            //same button configuration as the first interface
             TFT.fillrect(0, 0, 50, 50, Red);
             TFT.background(Red);
             TFT.locate(2,5);
@@ -100,7 +100,7 @@
             TFT.fillcircle(tx - 10, 100, 2, White);
             TFT.fillcircle(tx + 10, 100, 2, White);
             break;
-        case (4):
+        case (4): // whiteboard
             whiteboard();
             break;