sequencing analog read

i want to connect 3 lm35 and i want to sequence the the reading of them and i dont know how to work with arrays

Let me try to help you sharonhz

Im assuming lm35 refers to the temperature sensor.

Arrays come in many types, and are declared in many ways. Two I personally like to use are:

int intsArray[3]; //An array of integers 3 ints long

float floatArray[] = {0.0, 1.0, 0.5}; //An array of floats 3 floats long.

One more thing you need to know. to call a value from an array, you put an index number in the box: Serial.println(arrayName[index]);

BUT arrays are indexed from 0. so in the array i defined above as an example,

floatArray[0] = 0.0, floatArray[1] = 1.0, floatArray[2] = 0.5.

BE CAREFUL HERE. The Arduino Programmer will not detect if you type in an index that exceeds the length of your array. In that case the program would read data outside of the array. That would have strange and unpredictable impacts on your program.

I presume you will be using a single array to read all three of them?

Here's how I would do it:

float data[3];

void setup() {

void loop() {
data[0] = firstSensorReading;
data[1] = secondSensorReading;
data[2] = thirdSensorReading;

People like to use a for loop to read/write into arrays. I could show you how to do that if you'd like, but for 3 data points quite frankly i think a for loop just makes things more complicated.

Goodluck! Stef L