Use ESP-32s with YL-83 (rain sensor)receives the data aberrant

HI…

Use ESP-32s with YL-83 (rain sensor). When the code only receives the data of YL-83, the value on the serial port changes normally; the code is as follows:

Int rainPin = 13; //A0
Int greenLED = 12;
Int redLED = 14;
Void setup()
{
pinMode(rainPin, INPUT);
pinMode(greenLED, OUTPUT);
pinMode(redLED, OUTPUT);
Serial.begin(115200);
Delay(500);

}

Void loop()
{
Int sensorValue = analogRead(rainPin);

Serial.print(sensorValue);
Delay(500);
}

However, when the code opens the WIFI connection and receives the data of YL-83, the value on the sequence will not change; the code is as follows:
#include <WiFi.h>
Int rainPin = 13; //A0
Int greenLED = 12;
Int redLED = 14;
Void setup()
{
pinMode(rainPin, INPUT);
pinMode(greenLED, OUTPUT);
pinMode(redLED, OUTPUT);
Serial.begin(115200);
WiFi.mode(WIFI_STA);
Delay(500);
WiFi.begin(ssid, password);
While (WiFi.status() != WL_CONNECTED) //Wait for network connection
{
Delay(500);
Serial.print(".");
}
Serial.println(“WiFi connected!”);

Serial.print("IP address: ");
Serial.println(WiFi.localIP());
}

Void loop()
{
Int sensorValue = analogRead(rainPin);

Serial.print(sensorValue);
Delay(500);

}

How can I rule out this problem? Please Help…

That code doesn't compile. Please post the actual code you are using. Don't retype it. Copy and paste it from the IDE.

Void setup()

error

Delay(500);

error

Void loop()

error

Int rainPin = 13; //A0

error

The code is right…it’s can compile!

I have solved the problem!

I Have found the problem and solved it.

Maybe the code you had could compile. But what you posted wouldn't. I pointed out the errors.