Analog inputs fit well with analog outputs, for example connecting a 10k potentiometer to an analog input to control the brightness of an LED using PWM, allowing code as simple as: analogWrite( d3, analogRead( a3 ) / 4 ); I'm assuming here that analogRead() returns values between 0 and 1023 which need to be scaled down to 0..255