Skip to main content
Fixed typo in code.
Source Link
sa_leinad
  • 3.2k
  • 2
  • 24
  • 53

As I understand, you have multiple analog sensors you want to read. So your code should look something like this:

// assuming sensors are on A0, A1, A2, Ax

sensorPins [] = {A0, A1, A2};
int sensorNum = 3;

for(int x = 0; x < sensorNum; x++){
  readSensor(x);
}

Something like that should work for you.

As I understand, you have multiple analog sensors you want to read. So your code should look something like this:

// assuming sensors are on A0, A1, A2, Ax

sensorPins [] = {A0, A1, A2};
int sensorNum = 3;

for(int x = 0; x < sensorNum; x++){
  readSensor();
}

Something like that should work for you.

As I understand, you have multiple analog sensors you want to read. So your code should look something like this:

// assuming sensors are on A0, A1, A2, Ax

sensorPins [] = {A0, A1, A2};
int sensorNum = 3;

for(int x = 0; x < sensorNum; x++){
  readSensor(x);
}

Something like that should work for you.

Source Link

As I understand, you have multiple analog sensors you want to read. So your code should look something like this:

// assuming sensors are on A0, A1, A2, Ax

sensorPins [] = {A0, A1, A2};
int sensorNum = 3;

for(int x = 0; x < sensorNum; x++){
  readSensor();
}

Something like that should work for you.