User manual

The chosen colour is now transmitted in the form /?rgb=%23, followed by six more
characters. The expression %23 suggests that this is a hexadecimal digit. For the
colour white, the URL therefore is:
[IP]/?rgb=%23ffffff
The controller now needs to extract the individual colour values of the LED from
this HEX number, which is done in the following part of the loop-function:
if (esp8266.findUntil("?rgb=", "\n"))
{
String hexstring = esp8266.readStringUntil(‚ ‚);
long number = (long) strtol( &hexstring[3], NULL, 16);
int r = number >> 16;
int g = number >> 8 & 0xFF;
int b = number & 0xFF;
analogWrite(RED, r);
analogWrite(GREEN, g);
analogWrite(BLUE, b);
}
The function strtol() initially converts the text received behind %23 into a long-
figure and this then into three byte values by bit manipulation. These are then
transmitted to the RGB LED with the analogWrite()-function.
4.6 | Light sensor
In this project, the website of the web server is not used as control interface, but
as output element. The brightness measured via a brightness sensor is displayed
well-structured as a relative value with a new HTML element.
Setting up this experiment requires the photo transistor, which is used as a light