#define potpin 34
int valorCAD = 0;
float voltaje = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Ejercicio CAD");
}
void loop() {
// put your main code here, to run repeatedly:
valorCAD = analogRead(potpin);
voltaje = valorCAD*(3.3/4095);
Serial.print("Valor CAD = ");
Serial.println(valorCAD);
Serial.print("Voltaje = ");
Serial.println(voltaje);
delay(1000);
}