CIRCUITO POTENCIOMETRO

const int ledpin = 8;

const int potpin = A0;

int potValue = 0; // Corregido: "potValvue" -> "potValue"

int brightness = 0;

void setup() {

pinMode(ledpin, OUTPUT);

}

void loop() {

potValue = analogRead(potpin); // Corregido: "potvalue" -> "potValue"

// Corregido: "map" estaba incompleto (faltaba el 255)

brightness = map(potValue, 0, 1023, 0, 255);

// Corregido: "analogRead" -> "analogWrite"

analogWrite(ledpin, brightness);

delay(10);

}

¡Crea tu página web gratis! Esta página web fue creada con Webnode. Crea tu propia web gratis hoy mismo! Comenzar