int pin_dos = 2;
int brillo = 0;
const int frecuencia = 1000;
const int canal = 0;
const int resolucion =10;
int pot = 34;
void setup() {
Serial.begin(9600);
// put your setup code here, to run once:
ledcSetup (canal, frecuencia, resolucion);
ledcAttachPin(pin_dos, OUTPUT);
delay(1000);
}
void loop() {
// put your main code here, to run repeatedly:
brillo= analogRead(pot);
Serial.println(brillo);
brillo=(brillo/16.2);
Serial.println(brillo);
//ledcWrite(pin_dos, brillo);
analogWrite(pin_dos, brillo);
delay(1000);
}