School project.

Dependencies:   Timezone NTPClient BSP_DISCO_F746NG Grove_temperature

Revision:
17:01ebfd8ab87a
Parent:
16:296d68305630
Child:
19:a23c25da398e
--- a/main.cpp	Wed Jan 20 08:11:46 2021 +0000
+++ b/main.cpp	Wed Jan 20 14:22:46 2021 +0000
@@ -8,6 +8,7 @@
 mbed-os version 6.6.0
 BSP_DISCO_F746NG, revision 13:85dbcff by Team ST
 Grove_temperature, v1.0.0 by Toyomasa Watarai
+NTPClient, revision 0:9282d46 by Zoltan Hudak 
  
 @section Recommended hardware
 STM32F746G-DISCOVERY
@@ -23,12 +24,17 @@
 
 #include "mbed.h"
 #include "Grove_temperature.h"
+#include "stm32746g_discovery_lcd.h"
+#include "EthernetInterface.h"
+#include "NTPClient.h"
 
 AnalogIn light_sensor(A0);
 AnalogIn rotary(A1);
 DigitalIn button(D5);
 PwmOut led(D3);
 Grove_temperature temp(A2);
+EthernetInterface eth;
+NTPClient ntp(eth);
 /// Name of building to install the unit
 char building[31];
 /// Name of room to install the unit
@@ -58,28 +64,30 @@
 #include "sc_functions.h"
 #include "button_functions.h"
 #include "main_functions.h"
+#include "time_functions.h"
 
 
-int main(){        
+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 clock;
+    clock.start(&time_update_current_time);
+    
     Thread button_check;
     button_check.start(&main_run_button_check);
-        
+    
     while(1)
     {
         main_update_readings();
         main_check_light_control();
         
         wait_us(1000000);
-
+        
         /** Code for testing temperature sensor
             1/18/2021 - Working
         */