Update your browser to view this website correctly. Update my browser now
Read an analog input pin, map the result, and then use that data to dim or brighten an LED.
Making Analog In, Out Serial tuto
This example shows how to read an analog input pin, map the result to a range from 0 to 255, and then use that result to set the pulsewidth modulation (PWM) of an output pin to dim or brighten an LED.