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

Files at this revision

API Documentation at this revision

Comitter:
Owenmatthewmcgowan
Date:
Fri May 26 09:37:06 2017 +0000
Parent:
48:76ac309a2bd9
Parent:
47:731431234bd0
Commit message:
merge;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
main.cpp.orig Show annotated file Show diff for this revision Revisions of this file
diff -r 76ac309a2bd9 -r 243b5e826228 main.cpp
--- a/main.cpp	Fri May 26 09:34:38 2017 +0000
+++ b/main.cpp	Fri May 26 09:37:06 2017 +0000
@@ -29,6 +29,7 @@
             case (2): runanaclock(); break;// if(f_cycle){loopcount = (loopcount + 1) % (looplimit + 1); if (loopcount == looplimit) {f_state = 1; TFT.cls();} }break;
             case (4): whiteboard(); f_state = 1; break;
             //case (5): pong(); break; // pong removed - too slow
+
         }
     }
     
diff -r 76ac309a2bd9 -r 243b5e826228 main.cpp.orig
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp.orig	Fri May 26 09:37:06 2017 +0000
@@ -0,0 +1,41 @@
+bool f_alarm = false, f_alarm_sound=false;
+int f_state;
+bool f_cycle = false;
+int f_cycle_secs = 0;
+int f_cycle_wait = 5;
+#include "libs.h"
+//DigitalOut led(LED1);
+
+//DigitalIn sw_w(SW3);
+
+void main()
+{
+    while(!rtc.startClock()){}
+    TFT.claim(stdout);        // send stdout to the TFT display
+    TFT.set_orientation(1);
+    TFT.background(Black);    // set background to black
+    TFT.foreground(White);    // set chars to white
+    TFT.cls();
+    // pc.baud(115200);
+    f_state = 1;
+    f_alarm = false;
+    runclock();
+    int looplimit = 20 , loopcount = 0;
+    while (true) {
+        
+        switch (f_state){
+            case (1): runclock(); break;// if(f_cycle){loopcount = (loopcount + 1) % (looplimit + 1); if (loopcount == looplimit) {f_state = 2; TFT.cls();} }break;
+            case (3): settings();
+            case (2): runanaclock(); break;// if(f_cycle){loopcount = (loopcount + 1) % (looplimit + 1); if (loopcount == looplimit) {f_state = 1; TFT.cls();} }break;
+            case (4): whiteboard(); f_state = 1; break;
+            //case (5): pong(); break; // pong removed - too slow
+        }
+    }
+    
+    
+    //draw_state(4);
+
+
+
+
+}