Hi all, is there other ways of displaying "ON" "OFF" text in the web server?
Right now, i am just repeat the else if { } section to make the status of my room light 'ON' and 'OFF'.
static word homePage() {
bfill = ether.tcpOffset();
if ((l2<threshold)&&(l1<threshold)&&(l3<threshold))//000
{
bfill.emit_p(PSTR(
"HTTP/1.0 503 OK\r\r\r\r\n"
"Content-Type: text/html\r\n"
"Pragma: no-cache\r\n\n"
"\r\n"
"<meta http-equiv='refresh' content='5'/>" // refresh rate 5sec
"<title><h2>NYP Project</h2></title>" //To change the Tab name
"<body style='background-color:rgb(255,200,180);'>" // to change colour of the page
"<h1 style='text-align: center;'><em><span style='color: rgb(153, 0, 0);'>This is a testing page for Arduino system</span></em></h1>"
"<h1> NYP PROJECT</h1>" // Add header
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"<hr />"
"<hr />"
"<h1 style='text-align: center;'><b>Room monitoring system<b></h3>"
"<hr />"
"<h2>S449 Wireless Development Lab:
</h2>" //Group2 data
"<h3>Temperature : $D C
Humidity        : $D %
Light intensity : $D
"
"Room Light     : OFF
</h3><hr>"
"<h2>S439 Wireless Test & Measurment Lab:
</h2>" //Group 1 data
"<h3>Temperature : $D C
Light intensity : $D
Room Light     : OFF
</h3><hr>"
"<h2>S437 Embedded System Development Lab:
</h2>" //Group 3 data
"<h3>Temperature : $D C
Light intensity : $D
Room Light     : OFF
</h3><hr></h3><hr>"
),t2, h2,l2,t1, l1, t3,l3 ); // wanna to show l as text form.
}
else if ((l2<threshold)&&(l1<threshold)&&(l3>threshold))//001
{
bfill.emit_p(PSTR(
"HTTP/1.0 503 OK\r\r\r\r\n"
"Content-Type: text/html\r\n"
"Pragma: no-cache\r\n\n"
"\r\n"
"<meta http-equiv='refresh' content='5'/>" // refresh rate 5sec
"<title><h2>NYP Project</h2></title>" //To change the Tab name
"<body style='background-color:rgb(255,200,180);'>" // to change colour of the page
"<h1 style='text-align: center;'><em><span style='color: rgb(153, 0, 0);'>This is a testing page for Arduino system</span></em></h1>"
"<h1> NYP PROJECT</h1>" // Add header
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"<hr />"
"<hr />"
"<h1 style='text-align: center;'><b>Room monitoring system<b></h3>"
"<hr />"
"<h2>S449 Wireless Development Lab:
</h2>" //Group2 data
"<h3>Temperature : $D C
Humidity        : $D %
Light intensity : $D
"
"Room Light     : OFF
</h3><hr>"
"<h2>S439 Wireless Test & Measurment Lab:
</h2>" //Group 1 data
"<h3>Temperature : $D C
Light intensity : $D
Room Light     : OFF
</h3><hr>"
"<h2>S437 Embedded System Development Lab:
</h2>" //Group 3 data
"<h3>Temperature : $D C
Light intensity : $D
Room Light     : ON
</h3><hr></h3><hr>"
),t2, h2,l2,t1, l1,t3,l3 ); // wanna to show l as text form.
}
else if ((l2<threshold)&&(l1>threshold)&&(l3<threshold))//010
{
bfill.emit_p(PSTR(
"HTTP/1.0 503 OK\r\r\r\r\n"
"Content-Type: text/html\r\n"
"Pragma: no-cache\r\n\n"
"\r\n"
"<meta http-equiv='refresh' content='5'/>" // refresh rate 5sec
"<title><h2>NYP Project</h2></title>" //To change the Tab name
"<body style='background-color:rgb(255,200,180);'>" // to change colour of the page
"<h1 style='text-align: center;'><em><span style='color: rgb(153, 0, 0);'>This is a testing page for Arduino system</span></em></h1>"
"<h1> NYP PROJECT</h1>" // Add header
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"<hr />"
"<hr />"
"<h1 style='text-align: center;'><b>Room monitoring system<b></h3>"
"<hr />"
"<h2>S449 Wireless Development Lab:
</h2>"//Group2 data
"<h3>Temperature : $D C
Humidity        : $D %
Light intensity : $D
"
"Room Light     : OFF
</h3><hr>"
"<h2>S439 Wireless Test & Measurment Lab:
</h2>" //Group 1 data
"<h3>Temperature : $D C
Light intensity : $D
Room Light     : ON
</h3><hr>"
"<h2>S437 Embedded System Development Lab:
</h2>" //Group 3 data
"<h3>Temperature : $D C
Light intensity : $D
Room Light     : OFF
</h3><hr></h3><hr>"
),t2, h2,l2,t1, l1,t3,l3 ); // wanna to show l as text form.
}
below attachment is the full code of my RX. Thanks in advance
RX_v1.6.ino (16 KB)