QTR-8RC Reflectance Sensor Array Reading

I am unable to get digital outputs like 1 and 0 from this sensor panel when detecting white lines and black lines.I tried a very simple code.When I coded for these kind of outputs it remained “00000000” for both black and white.Can anyone help me to figure this out?

The Code

void setup() {
  Serial.begin(9600);
  pinMode(38,INPUT);
  pinMode(40,INPUT);
  pinMode(42,INPUT);
  pinMode(44,INPUT);
  pinMode(46,INPUT);
  pinMode(48,INPUT);
  pinMode(50,INPUT);
  pinMode(52,INPUT);
  pinMode(36,INPUT);
  

}

void loop() {
  Serial.print(digitalRead(38));
  Serial.print(digitalRead(42));
  Serial.print(digitalRead(44));
  Serial.print(digitalRead(46));
  Serial.print(digitalRead(48));
  Serial.print(digitalRead(50));
  Serial.print(digitalRead(40));
  Serial.print(digitalRead(52));
  Serial.println("");
  delay(1500);
  
  
}

Hey there!

Pololu’s qtr-8rc reflectance senosr can be programmed using qtr library https://github.com/pololu/qtr-sensors-arduino
You should look at examples and than you will know how to use it.

Kindest regards!

1 Like

Thank You Very Much andrija004.