Need Help .Problem getting data when i use array with moisture soil sensors.

Hello
i am using arduino uno. and three moisture soil sensors.

In my code i use ARRAY as you will see in my code down. I connect my moisture soil sensors with pins: A0, A1, A2. My problem is that i am getting data only from pin A0. i do not get data from A1, and A2 pins . And the three moisture soil sensors are new working fine alone when i connected with AO. the same problem is also with the other arduino uno that i have when i use the same code. Can someone help me?
Thaks alot!

#include <SoftwareSerial.h>
#include <Wire.h>

const byte sensorPins[] = {A0, A1, A2};
int sensorValue = 0;
int i;

void doSoilSensor(byte sensorNo)
{
  int sensorValue = analogRead(sensorPins);
  delay(1000);
  Serial.print("sensor = " );
  Serial.println(sensorValue);
}

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  for (i = 0; i < sensorPins; i++)
  {
    doSoilSensor(sensorValue);
  }
}

That's not the way you use arrays. Please spend some time studying the Arduino Language Reference page on arrays:
https://www.arduino.cc/reference/en/language/variables/data-types/array/

the parameter for analogRead is an int

#include <SoftwareSerial.h>
#include <Wire.h>

const int sensorPins[] = {A0, A1, A2};
int sensorValue = 0;
int i;

void doSoilSensor(int sensorNo)
{
  int sensorValue = analogRead(sensorPins[sensorNo]);
  delay(1000);
  Serial.print("sensor = " );
  Serial.println(sensorValue);
}

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  for (i = 0; i < 3; i++)
  {
    doSoilSensor(i);
  }
}

thank you very much.

It would be much more helpful in my study if someone can quide me , in my code, the points I should concentrate on in order to study and make the necessary changes for the code to work.

Go through the code line by line. As soon as you hit something you don't understand, start doing some research. The Language Reference is a good place to start:
http://www.arduino.cc/reference/en
If that doesn't have what you're looking for, try Google. You'll often find the information you need by adding the "arduino" keyword to your search. If not, try "c++" instead. Arduino sketches are actually compiled as C++, so basic information you find on C++ will also apply to writing Arduino code.

Once you think you understand that line of code, write a simple sketch that uses the new concepts you learned and then run it to verify it works as expected.

If you end up with a specific question that you can't find an answer to after some research, feel free to ask here and we'll see if we can help out.

Which language is more close to Arduino ? C language or C++ ?

C++. In order to make Arduino programming a little more beginner friendly, the Arduino IDE does a little bit of preprocessing on the .ino files of the Arduino sketch to allow you to skip a couple of tedious things required for it to be valid C++ code, which would make the learning curve a bit steeper for beginners. After that, the code in your .ino files is valid C++ and is compiled as C++.

Here’s the preprocessing that’s done on .ino files:

  • If there are multiple .ino files in the sketch, concatenate them into a single file, starting with the file that matches the sketch folder name, followed by the rest in alphabetical order.
  • Add #include <Arduino.h> at the top of the file.
  • Insert automatically generated function prototypes for any function that doesn’t already have one.
  • Add #line directives to make warning/error messages still match the original sketch files.

If you want to add #include <Arduino.h> to your .ino files and write your own function prototypes so that your sketches are written in 100% valid C++, that’s fully supported. The Arduino IDE just automates some of that if you haven’t already done it yourself.

If you do want to write C, you can add a tab to your sketch with the .c extension. Those files will be compiled as C code. Similarly, you can add .cpp files, which will be compiled as C++, or .S files which will be compiled as assembly. The Arduino IDE only does sketch preprocessing on .ino files. It won’t mess with the code in .cpp, .c, or .S files at all.

Thank you very much.

C++ is a super-set of C. If you don't want to use the added features of C++ (mainly classes supporting Object Oriented Programming), just write straight C code in your .ino file and it will compile just fine.

well i am not a programmer but i have spent quite a lot time with no success or with success, in C language i dont know, so it seems to be hard starting learning again more i C++. But anyway i shall give a try.

TRAIST:
i have spent quite a lot time with no success

That usually is caused by jumping right into an advanced project without taking the time to learn the fundamentals first. I know it might seem slow to start with the basics, but it can really save a lot of time and frustration in the end. There is a nice collection of example sketches here:

Start with 1.Basics > BareMinimum, then 1.Basics > Blink, then move on through them from there. Make sure you understand every line of each sketch completely before moving to the next tutorial. Run the sketch on your Arduino to make sure it works, then make some modifications to the sketch and verify that you get the expected results when you run it on the Arduino. If some of the later tutorials are about a topic that you don't need for your project, you can skip over those.

Thank you veru much for the advise. I gine a try !