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