Alix & Sam's combined versions
Dependencies: BMP280 ELEC350-Practicals-FZ429 TextLCD BME280 ntp-client
Revision 11:42b0c567cc8c, committed 2018-12-13
- Comitter:
- Alix955
- Date:
- Thu Dec 13 15:46:07 2018 +0000
- Parent:
- 10:eea19f8e6122
- Commit message:
- Newest version of alix & sam
Changed in this revision
LCD.hpp | Show annotated file Show diff for this revision Revisions of this file |
Network.hpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/LCD.hpp Thu Dec 13 15:24:22 2018 +0000 +++ b/LCD.hpp Thu Dec 13 15:46:07 2018 +0000 @@ -133,10 +133,11 @@ Timemsg.time = time; Timemsg.year = year; Timemsg.current_time = current_time; - return Timemsg; flip = 3; //will tell the user that the time has been updated on next FLIP instance with the LCD + return Timemsg; //swap this for a function that sends the structure to ollie? + }
--- a/Network.hpp Thu Dec 13 15:24:22 2018 +0000 +++ b/Network.hpp Thu Dec 13 15:46:07 2018 +0000 @@ -27,47 +27,43 @@ -#define HTTP_STATUS_LINE "HTTP/1.0 200 OK" + +#define HTTP_STATUS_LINE "HTTP/1.0 200 OK" #define HTTP_HEADER_FIELDS "Content-Type: text/html; charset=utf-8" - #define HTTP_MESSAGE_BODY1 "" \ "<html>" "\r\n" \ " <body style=\"display:flex;text-align:center\">" "\r\n" \ -" <div style=\"margin:auto\">" "\r\n" \ -" <h1>Alright sunshine</h1>" "\r\n" \ +" <div id=\"Sensor Data\" name=\"Sensor Date\" style=\"margin:auto\">" "\r\n" \ +" <h1> <b>Sensor Data</b> </h1>" "\r\n" \ " <p>The LDR value is " #define HTTP_MESSAGE_BODY2 "" \ - "</p>" "\r\n" \ + " Lux </p>" "\r\n" \ +" <div style=\"margin:auto\">" "\r\n" \ +" <p>The Temperature value is " + +#define HTTP_MESSAGE_BODY3 "" \ + " Degrees</p>" "\r\n" \ +" <div style=\"margin:auto\">" "\r\n" \ +" <p>The Pressure value is " + +#define HTTP_MESSAGE_BODY4 "" \ + " mbar </p>" "\r\n" \ +" <div style=\"margin:auto\">" "\r\n" \ +" <p>The current Time is " + +#define HTTP_MESSAGE_BODY5 "" \ + " </p>" "\r\n" \ " </div>" "\r\n" \ " </body>" "\r\n" \ "</html>" -#define HTTP_MESSAGE_BODY3 "" \ -"<html>" "\r\n" \ -" <body style=\"display:flex;text-align:center\">" "\r\n" \ -" <div style=\"margin:auto\">" "\r\n" \ -" <p>The Temperature value is " - -#define HTTP_MESSAGE_BODY4 "" \ - "</p>" "\r\n" \ -" </div>" "\r\n" \ -" </body>" "\r\n" \ -"</html>" + -#define HTTP_MESSAGE_BODY5 "" \ -"<html>" "\r\n" \ -" <body style=\"display:flex;text-align:center\">" "\r\n" \ -" <div style=\"margin:auto\">" "\r\n" \ -" <p>The Pressure value is " + -#define HTTP_MESSAGE_BODY6 "" \ - "</p>" "\r\n" \ -" </div>" "\r\n" \ -" </body>" "\r\n" \ -"</html>" - + #define HTTP_RESPONSE HTTP_STATUS_LINE "\r\n" \ HTTP_HEADER_FIELDS "\r\n" \ "\r\n" \ @@ -210,7 +206,6 @@ - //Build the C++ string response response = HTTP_MESSAGE_BODY1; @@ -219,26 +214,18 @@ response += HTTP_MESSAGE_BODY2; - + response += temp_str; - response = HTTP_MESSAGE_BODY3; + response += HTTP_MESSAGE_BODY3; - response += temp_str; + response += pressure_str; response += HTTP_MESSAGE_BODY4; - - - response += HTTP_MESSAGE_BODY5; - - //response += pressure_str; - - response += time; + response += time; - - response += HTTP_MESSAGE_BODY6; - - + response += HTTP_MESSAGE_BODY5; +