User manual

Evaluation in the program works as follows now: Let us assume that boxes 3, 5
and 7 have been selected in the form. The URL changes to:
[IP]/?ld3=on&ld5=on&ld7=on
This means that only selected boxes will be submitted and can be identified based
on the index. This is done in the loop-routine. First, the entire port D on which the
digital outputs are pending is switched to low. Then a while-loop will scan for all
»ld«s in the resource link. The index of the ld found, at ld3 this would, for example,
be 3, permits shifting a 1 in a byte by the index 3 mentioned, and create the byte
0b0001000. This is then or-linked to the current value of the byte. This is done with
all submitted indexes, until the output register of D has the right value. This form of
output instead of digitalWrite() is probably a bit unusual for Arduino users, but
much more practical in this case.
if (esp8266.find("+IPD,"))
{
debug("Incoming Request");
int connectionId = esp8266.parseInt();
if (esp8266.find("/?")) PORTD = B00000000;
while (esp8266.findUntil("ld", "\n"))
{
int ld = esp8266.parseInt();
PORTD |= (1 << ld);
}
}
Vice versa, checkbox output works as follows: The placeholders from the HTML
document are swapped in the createWebsite()-function. A for-loop will go through
all ports used in series. If the pin is high (again determined by comparison to a
byte that was created by shifting the high bit by the digits of the index), the place-
holder with the index is replaced by the text checked. When the pin is low, the
placeholder is simply deleted. This ensures proper display of the active ports.
String createWebsite()