const int led = 9;
const int pot = A0;
void setup() {
pinMode(led, OUTPUT);
}
void loop() {
int potValue = analogRead(pot);
int pwmValue = map(potValue, 0, 1023, 0, 255);
analogWrite(led, pwmValue);
}
const int led = 9;
const int pot = A0;
void setup() {
pinMode(led, OUTPUT);
}
void loop() {
int potValue = analogRead(pot);
int pwmValue = map(potValue, 0, 1023, 0, 255);
analogWrite(led, pwmValue);
}