Download Print this page

Seeed Grove Manual page 9

Voltage divider
Hide thumbs Also See for Grove:

Advertisement

void
loop(){
long
sensorValue=analogRead(A0);
long
sum=0;
for(int
i=0;i<1000;i++)
{
sum=sensorValue+sum;
sensorValue=analogRead(A0);
delay(2);
}
sum=sum/1000;
Serial.print("if you set the Gain to 10,the input
Serial.println(10*sum*4980/1023.00);
Serial.print("if you set the Gain to 3,the input
Serial.println(3*sum*4980/1023.00);
delay(1000);
}
voltage:");
voltage:");
6

Advertisement

loading