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

Committer:
Owenmatthewmcgowan
Date:
Fri May 26 08:47:07 2017 +0000
Revision:
47:731431234bd0
Parent:
40:05798eeadd02
Child:
49:243b5e826228
comment;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Owenmatthewmcgowan 32:56f59b79720c 1 bool f_alarm = false, f_alarm_sound=false;
Owenmatthewmcgowan 19:4c30c3182e04 2 int f_state;
mlin 40:05798eeadd02 3 bool f_cycle = false;
mlin 9:eee503060d69 4 #include "libs.h"
Owenmatthewmcgowan 12:50289d0ac834 5 //DigitalOut led(LED1);
Owenmatthewmcgowan 19:4c30c3182e04 6
Owenmatthewmcgowan 12:50289d0ac834 7 //DigitalIn sw_w(SW3);
cstevens 6:18c7288b5e00 8
mlin 9:eee503060d69 9 void main()
dreschpe 0:7c3b9bfd6ead 10 {
Owenmatthewmcgowan 19:4c30c3182e04 11 while(!rtc.startClock()){}
dreschpe 0:7c3b9bfd6ead 12 TFT.claim(stdout); // send stdout to the TFT display
dreschpe 0:7c3b9bfd6ead 13 TFT.set_orientation(1);
dreschpe 0:7c3b9bfd6ead 14 TFT.background(Black); // set background to black
dreschpe 0:7c3b9bfd6ead 15 TFT.foreground(White); // set chars to white
mlin 11:1da15361a35b 16 TFT.cls();
mlin 11:1da15361a35b 17 // pc.baud(115200);
Owenmatthewmcgowan 19:4c30c3182e04 18 f_state = 1;
Owenmatthewmcgowan 19:4c30c3182e04 19 f_alarm = false;
Owenmatthewmcgowan 19:4c30c3182e04 20 runclock();
mlin 10:9d9b3b9b28b8 21 while (true) {
Owenmatthewmcgowan 29:684e2a3e17b5 22 switch (f_state){
Owenmatthewmcgowan 29:684e2a3e17b5 23 case (1): runclock(); break;
Owenmatthewmcgowan 29:684e2a3e17b5 24 case (3): settings(); break;
mlin 38:3fe3bafbf0c7 25 case (2): runanaclock(); break;
Owenmatthewmcgowan 29:684e2a3e17b5 26 case (4): whiteboard(); f_state = 1; break;
mlin 40:05798eeadd02 27 case (5): pong(); break;
Owenmatthewmcgowan 47:731431234bd0 28 //case (5): f_state = 1; break;
Owenmatthewmcgowan 29:684e2a3e17b5 29 }
Owenmatthewmcgowan 19:4c30c3182e04 30 }
mlin 16:3cb9b1fbc039 31
mlin 16:3cb9b1fbc039 32
Owenmatthewmcgowan 19:4c30c3182e04 33 //draw_state(4);
mlin 11:1da15361a35b 34
mlin 11:1da15361a35b 35
mlin 11:1da15361a35b 36
cstevens 6:18c7288b5e00 37
dreschpe 0:7c3b9bfd6ead 38 }