int pinR=3;
int pinButton=A1;
void setup() {
pinMode(pinR, OUTPUT);
pinMode(pinButton, INPUT_PULLUP);
// put your setup code here, to run once:
}
void loop() {
int value=analogRead(pinButton);
int ledValue=map(value,0,1023,0,255)
analogWrite(pinR,ledValue);
// put your main code here, to run repeatedly:
}