#define pinPWM 11 // len piny 11,10,9,6,5,3
#define pinADC A0 // len piny A0,A1,A2,A3,A4,A5
void setup()
{
 pinMode(pinPWM, OUTPUT);
 pinMode(pinADC, INPUT);
}
void loop()
{
 int adc = analogRead(pinADC); // hodnota 0-1023
 int pwm = map(adc,0,1023,0,255); // prevod 10b na 8b (0-255)
 analogWrite(pinPWM, pwm);
}