Hello, I bought a QTR8C about one week ago and it appears to be working only with the library; I dont want to use the library. Is there something I can do to fix this?
I tried using the following code to read digital values from it, however, I only get zeros after making sure it is powered correctly. Also, I am not sure if it is important but I disconnected the emitter pin.
int rc1, rc2, rc3, rc4, rc5, rc6, rc7, rc8; // readings from 8 sensors on the side qtr array
void setup() {
for (int x = 3; x<=10;x++){
pinMode(x,INPUT);
}
Serial.begin(250000);
}
void loop() {
readValues();
}
void readValues(){
//Readings from the front qtr array
rc1 = digitalRead(3);
rc2 = digitalRead(4);
rc3 = digitalRead(5);
rc4 = digitalRead(6);
rc5 = digitalRead(7);
rc6 = digitalRead(8);
rc7 = digitalRead(9);
rc8 = digitalRead(10);
Serial.print(rc1);
Serial.print("\t");
Serial.print(rc2);
Serial.print("\t");
Serial.print(rc3);
Serial.print("\t");
Serial.print(rc4);
Serial.print("\t");
Serial.print(rc5);
Serial.print("\t");
Serial.print(rc6);
Serial.print("\t");
Serial.print(rc7);
Serial.print("\t");
Serial.print(rc8);
Serial.println(" ");
delay(200);
}