School project.

Dependencies:   Timezone NTPClient BSP_DISCO_F746NG Grove_temperature

Revision:
16:296d68305630
Parent:
15:638e65c37d58
Child:
17:01ebfd8ab87a
--- a/main.cpp	Tue Jan 19 10:05:13 2021 +0000
+++ b/main.cpp	Wed Jan 20 08:11:46 2021 +0000
@@ -41,10 +41,14 @@
 /// The percentage of rotary turned
 int rotary_setting;
 
+/// Used to determine if change in temperature has occured when new readings are performed
 int current_temp;
+/// Used to check if temperature unit should be switched or not
+bool switch_temp;
 bool is_fahrenheit = false;
 
-DigitalOut myled(LED1);
+
+/*DigitalOut myled(LED1);*/
 
 #include "helper_functions.h"
 #include "setup_functions.h"
@@ -56,26 +60,23 @@
 #include "main_functions.h"
 
 
-int main(){
-    bool switch_temp;
-        
-    lcd_initialize();
-    lcd_show_setup_screen();
-    setup_run_setup();
-    lcd_show_main_screen();
-    lcd_update_lower_left(building, room);
+int main(){        
+    main_run_setup();
+    main_run_main_screen();
+    
+    /// TODO: Time function
     lcd_update_upper_left();
     
     Thread serial_communication;
     serial_communication.start(&sc_run_service);
+    
+    Thread button_check;
+    button_check.start(&main_run_button_check);
         
     while(1)
     {
-        update_readings();
-        check_light_control();
-        switch_temp = button_switch_temp_unit(button, is_fahrenheit);
-        update_temperature(switch_temp);
-        switch_temp = false;
+        main_update_readings();
+        main_check_light_control();
         
         wait_us(1000000);