Please help. Newbie

sorry for my bad english.

the webservercontrol is working fine,but i want to move the Relay status display next to the control button, and how to do that. thank you.

this is now

Device 1 ON Device 1 OFF

Device 2 ON Device 2 OFF

Device 3 ON Device 3 OFF

Device 4 ON Device 4 OFF

Device 5 ON Device 5 OFF

Device 6 ON Device 6 OFF

Device 7 ON Device 7 OFF

Device 8 ON Device 8 OFF

Device 1. Device 2. Device 3. Device 4. Device 5. Device 6. Device 7. Device 8.
OFF ON ON OFF ON OFF OFF OFF

i want this

Device 1 ON Device 1 OFF Device 1.ON

Device 2 ON Device 2 OFF Device 2. ON

Device 3 ON Device 3 OFF Device 3. ON

Device 4 ON Device 4 OFF Device 4. ON

Device 5 ON Device 5 OFF Device 5. ON

Device 6 ON Device 6 OFF Device 6. ON

Device 7 ON Device 7 OFF Device 7. ON

Device 8 ON Device 8 OFF Device 8. ON

WebServerControl.ino (20.1 KB)

Do you know what and do/mean? If not, time to go to school

Put all the data you want in one row between that row’s and tags.

Frankly, that code contains way too much duplication. The tag is printed twice - once of the pin is high and once if it is low. It needs to be printed once. The

tag is printed twice - once of the pin is high and once if it is low. It needs to be printed once. The only thing that the if/else statements should print differently is the ON or OFF string.

yes. i really dont know how to do that,can you make a sample.thanks

ok. here the code:
Original code

client.println(F("<a href="/?relay1on""> <button style=“width:280px;height:80px”> <font size=“5”; color:red ;>Device 1 ON “));
client.println(F(”<a href="/?relay1off""> <button style=“width:280px;height:80px”> <font size=“5”>Device 1 OFF
"));

if (digitalRead(RELAY_CH1))
{
client.print(F(" <p style=“font-family:arial;color:black;font-size:20px;”>Device 1.

<p style=“font-family:arial;color:green;font-size:30px;”>ON

“));
}
else
{
client.print(F(” <p style=“font-family:arial;color:black;font-size:20px;”>Device 1.

<p style=“font-family:arial;color:red;font-size:30px;”>OFF

"));
}
new edit:

client.println(F(""));
client.println(F("<table border=“5”>"));
client.println(F(""));

client.println("<a href="/?relay1on""> <button style=“width:300px;height:100px”> <font size=“6”; color:red ;>Device 1 ON “);
client.println(”<a href="/?relay1off""> <button style=“width:300px;height:100px”> <font size=“6”>Device 1 OFF ___");

if (digitalRead(RELAY_CH1))
{
client.print(" <a style=“font-family:arial;color:black;font-size:26px;”>Device 1.<a style=“font-family:arial;color:green;font-size:35px;”>ON");
}
else
{
client.print("<a style=“font-family:arial;color:black;font-size:26px;”>Device 1.<a style=“font-family:arial;color:red;font-size:35px;”>OFF");
}

and it come up:

Device 1 ON Device 1 OFF ___ Device 1.ON
(table border show here)

but the table border of the Device 1.OFF show in center of page and under the Device 1 OFF.

ANY idea plaese.

Draw a picture, using paper and pen. The picture needs to contain a table. In each cell, write where the data is to come from.

Then, writing the code to get that data, for that row, column is easy.