Back to Parent

//loop through every pin

for (int j = 0; j < nSensorsPerMux; j++){

//loop through the 3 sig

for(int i = 0; i < 3; i ++){

digitalWrite(controlPin1[i], muxChannel[j][i]);

digitalWrite(controlPin2[i], muxChannel[j][i]);

}

//read the value at the Z pin

int val1 = analogRead(comPin1);

int val2 = analogRead(comPin2);

//populate array

sensorVals[j] = val1;

total += val1;

if (j != nSensorsPerMux -1){

sensorVals[j + nSensorsPerMux] = val2;

total += val2;

}
Click to Expand

Content Rating

Is this a good/useful/informative piece of content to include in the project? Have your say!

0