void loop() {
int val1 = analogRead(SM1_PIN); // read the analog value from sensor
int val2 = analogRead(SM2_PIN); // read the analog value from sensor
int val3 = analogRead(SM3_PIN); // read the analog value from sensor
Please edit your post, select all code and click the </> button to apply so-called code tags and next save your post. It makes it easier to read, easier to copy and the forum software will display it correctly.
Your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advice on) your project See About the Installation & Troubleshooting category.
Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'
Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination
Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.
Please include the entire error message. It is easy to do. There is a button (lower right of the IDE window) called "copy error message". Copy the error and paste into a post in code tags. Paraphrasing the error message leaves out important information.
Post a schematic.
Post an image of your project.
What kind of soil moisture sensors is the OP using? Post an image. Did the OP take calibration readings of each sensor to be used in detecting wetness?