int LED_PIN =11;
int POTENTIOMETER_PIN =A0;
void setup() {
pinMode(LED_PIN, OUTPUT); // تعيين LED كمخرج
}
void loop() {
int potentiometerValue = analogRead(POTENTIOMETER_PIN); // قراءة قيمة البوتنشيومتر
int brightness = map(potentiometerValue, 1500, 0, 800, 0); // تحويل القيمة إلى مدى 0-255
analogWrite(LED_PIN, brightness); // ضبط سطوع المصباح
}