Proj 324 Final

Fork of ELEC351_Group_T by Plymouth ELEC351 Group T

Revision:
11:e7b5ed6cd3cf
Parent:
10:46946784326d
Child:
12:536eca338ae8
--- a/main.cpp	Wed Dec 20 14:32:40 2017 +0000
+++ b/main.cpp	Wed Dec 20 14:43:55 2017 +0000
@@ -154,14 +154,21 @@
     pc.printf("Hello World \n");
     while(1)
     {
-        osEvent evt = mail_box.get();   //Get the latest entry from "mail_box"
+        osEvent evt = mail_box.get();                                   //Get the latest entry from "mail_box"
         
         if (evt.status == osEventMail){
-            DATA *Rec_Data = (DATA*)evt.value.p;  
-            pc.printf("Time = %d\t", Rec_Data->get_time());                 //Print Time
-            pc.printf("Temperature = %f", Rec_Data->get_temperature());     //Print Temperature
-            pc.printf("Pressure = %f", Rec_Data->get_pressure());           //Print Pressure
-            pc.printf("Light = %f", Rec_Data->get_light());                 //Print Light
+            DATA *Rec_Data = (DATA*)evt.value.p;
+            DATA msg;
+            
+            msg.set_time(Rec_Data->get_time());
+            msg.set_temperature(Rec_Data->get_temperature());
+            msg.set_pressure(Rec_Data->get_pressure());
+            msg.set_light(Rec_Data->get_light());  
+            
+            pc.printf("Time = %d\t", msg.get_time());                 //Print Time
+            pc.printf("Temperature = %f", msg.get_temperature());     //Print Temperature
+            pc.printf("Pressure = %f", msg.get_pressure());           //Print Pressure
+            pc.printf("Light = %f", msg.get_light());                 //Print Light
         }
         
         pc.printf("Test\n");//Use this Line to output a string to Putty