You are on page 1of 1

float voltage;

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}

void loop() {
// put your main code here, to run repeatedly:
int sensorValue = analogRead(A0); //Lee lo que se ingresa por el pin
analogo //"0" cero.
/* if(sensorValue<1){
voltage=0;
}*/
// Convert the analog reading (which goes from 0 -1023) to a voltage (0 -5V):
voltage = sensorValue * (5.0 / 1023.0); // Convierte los datos le�dos a una
//traducci�n de un voltaje de (0 - 5) voltios.

Serial.println(voltage);
// Imprime en la terminal de Arduino IDE el valor
}

You might also like