Datasheet

3
4. Test Code
int sensorPin =A0 ; //define the analog port A0
int value = 0; //set value to 0
void setup()
{
Serial.begin(9600);//Set baud rate
}
void loop()
{
value = analogRead(sensorPin); //Set value to the read value of A0
Serial.println(value, DEC); //diaplay value and enter a new line
delay(100); //delay in 0.1S
}
5. Test Result
After the line is connected, upload the program code, then open the serial
monitor and set the baud rate to 9600. It will display the data as shown in the
picture below.