const int photo = A0;
int pwm_valu = 0;
const int led = 11;
void setup() {
// put your setup code here, to run once:
pinMode(photo, INPUT);
pinMode(led, OUTPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
int value = analogRead(photo);
pwm_valu = map(value ,0,1023,0,255);
Serial.println(pwm_valu);
analogWrite(led, pwm_valu);
delay(100);
}