const int ledPin=9;
int AD_value=0;
int mapValue;
void setup() {
// put your setup code here, to run once:
pinMode(ledPin,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
AD_value=analogRead(A0);
mapValue=map(AD_value,0,1023,0,255);
analogWrite(ledPin,mapValue);
delay(10);
}