Analog Input/Output

Potentiometer values are read in through an 'Analog In' pin. The values are then used to control the modulation of an LED on a PWM pin.

Use a 1kΩ potentiometer, an LED and a 220Ω resistor. Connect three wires from the Potentiometer to the Arduino board. The first goes to ground from one of the outer pins of the potentiometer. The second goes from 5 volts to the other outer pin of the potentiometer. The third goes from analog input 2 to the middle pin of the potentiometer. Connect the LED through a resistor to a PWM pin and ground.