Serial.begin(9600);
}
void
loop() {
float
vol;
int
sensorValue
vol=(float)sensorValue/1023*Vref;
Serial.print("The sensorValue is
Serial.println(sensorValue);
Serial.print("The analog value is
Serial.print(vol);
Serial.println("V");
delay(100);
}
The result is:
As default, Vref is generated by Arduino which is theoretically 5V. But actually that is a value afloat which
results the deviation of the final data. This kind of inaccuracy is avoided when using Grove - I2C ADC,
because it provides a strict 3.0V as Vref.
= analogRead(A0);
");
13
");
Need help?
Do you have a question about the Grove-I2C ADC and is the answer not in the manual?