//https://github.com/ostad-ai/Arduino-Tutorial
//Threads, Instagram: @ostad.ai
// Controlling the brightness of an LED with a slide potentiometer
// with analogRead, we read the analog value at the pin of slide potentiometer
// with analogWrite, we write a PWM with duty-cycle related to the brightness
//click on the play at the right window, and move the slide with mouse
const int LED_pin=11;
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
int value=analogRead(A0);
int brightness=map(value,0,1023,0,255);
analogWrite(LED_pin,brightness);
delay(20);
}