I'm working on a photoresistor array with my arduino, and I'm having a little trouble getting stable readings.
I'm driving 7 rows one at a time with Arduino's digitalWrite(pin,HIGH)
command and floating the other outputs with pinMode(pin,INPUT);
Problem is, I got NO READING from my analogRead()
voltage dividers unless the column is hooked up to my ohmmeter. Whats up with that?
Only the column connected to my ohmmeter outputs anything at all, all the other columns read zero. Whats in my ohmmeter that suddenly makes that sensor work?
So if I connect my Ohm-meter to the positive rail of P1 and to MEGA Analog 0 (A0) connection, suddenly the whole column gets readings! Otherwise, zeros everywhere.
void readArray()
{
for(int i=0; i < ROWS; i++)
{
for(int k=0; k<ROWS; k++)
{
pinMode(rowPins[k], INPUT);
}
pinMode(rowPins[i],OUTPUT);
digitalWrite(rowPins[i],HIGH);
delay(250);
for(int j=0; j < COLS; j++)
{
holdVals[i][j] = analogRead(j);
Serial.println(holdVals[i][j]);
}
digitalWrite(rowPins[i],LOW);
}
}