void setup() {
// put your setup code here, to run once:
pinMode(3, OUTPUT);
pinMode(A1, INPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
int x=analogRead(A1);
Serial.print("x: ");
Serial.println(x);
int y=map(x,0,1023,0,255);
Serial.print("y: ");
Serial.println(y);
analogWrite(3,y);
delay(100);
}