// now do the same for the other sensor and LED: leftSensorValue = analogRead(A1); // read the pot value // map the sensor value to the brightness again. No need to // declare the variable again, since you did so above: brightness = map(leftSensorValue, 400, 900, 0, 255); analogWrite(greenLED, brightness); // set the LED brightness with the result Serial.println(leftSensorValue); // print the sensor value back to the serial monitor }