void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
 
  pinMode(2,OUTPUT);
  pinMode(4,INPUT);
}

void loop() {
   int x= analogRead(4);
 analogWrite(2,x/16);
  Serial.print("brightness: ");
   Serial.println(x);
}