NodeMCU ESP8266 Web Server Control LED Brightness (PWM)

Here to build an ESP8266 NodeMCU web server with a slider to control the LED brightness. You’ll learn how to add a slider to your web server projects, get its value and save it in a variable that the ESP8266 can use. We’ll use that value to control the duty cycle of a PWM signal and change the brightness of an LED.

The ESP8266 hosts a web server that displays a web page with a slider;

When you move the slider, you make an HTTP request to the ESP8266 with the new slider value;

SLIDERVALUE is a number between 0 and 1023. You can modify your slider to include any other range;