const int ledPin = 12 ;
const int potPin =A0 ;
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop () {
int potValue = analogRead(potPin);
int ledBrightness = map(potValue, 0, 1023, 0, 255);
analogWrite(ledPin,ledBrightness);
delay(10);
}
const int ledPin = 12 ;
const int potPin =A0 ;
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop () {
int potValue = analogRead(potPin);
int ledBrightness = map(potValue, 0, 1023, 0, 255);
analogWrite(ledPin,ledBrightness);
delay(10);
}