int adcValue; // our adc value
float voltage; // calculated voltage level
void setup() {
// put your setup code here, to run once:
Serial.begin(9600); // serial port with baud rate (speed) of 9600
}
void loop() {
// put your main code here, to run repeatedly:
adcValue = analogRead(A0); // read and convert analog signal of A0 to digital
voltage = adcValue * (5.0 / 1023.0); // calculate voltage according to adc
// send results to computer
Serial.print("convertValue:");
Serial.println(adcValue);
Serial.print("Voltage:");
Serial.println(voltage);
delay(500); // delay 500 ms
}