Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BME280 BMP280 TextLCD
Revision 11:e7b5ed6cd3cf, committed 2017-12-20
- Comitter:
- chills
- Date:
- Wed Dec 20 14:43:55 2017 +0000
- Parent:
- 10:46946784326d
- Child:
- 12:536eca338ae8
- Commit message:
- 2017_12_20 14:40; Second Attempt at mail_box;
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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