Qtr-8rc white line detection problem

Hi.I am making a line follower robot using qtr-8rc sensor array and arduino uno. While calibrating the sensors using QTRRCExample, I found that I got desirable result while testing the array with a black line on white surface. But when it comes to white line on a black surface,I’m not getting the desired position value.

0 22 363 314 476 348 558 625 4856
0 0 408 344 545 407 643 766 4909
0 0 391 349 548 413 630 751 4906
0 0 389 346 493 391 577 680 4855
0 0 389 346 528 391 611 715 4883
0 0 389 341 510 372 592 699 4872
0 0 365 317 494 372 577 697 4910
0 0 386 341 510 387 610 712 4892
0 0 367 319 496 372 578 680 4894
0 0 389 346 530 411 628 732 4902
0 0 410 346 545 411 646 751 4897
0 0 369 317 511 372 593 699 4908
0 0 386 344 510 391 592 697 4873
0 0 386 341 526 407 608 731 4901
0 0 345 319 479 372 578 682 4924
0 0 345 319 476 372 562 663 4904
0 0 389 346 526 411 628 732 4903
0 0 389 344 545 411 628 751 4911

here the position should be at 0 instead of around 4900.
Please help me regarding this problem

Hello.

Did you set the whiteLine argument to 1 for the readLine function in the main loop of the QTRRCExample code? It might be helpful for you to read this post that explains the purpose of the whiteLine argument in the readLine method of the QTRSensor library. For more details about that method and its parameters, see its function definition in QTRSensors.cpp.

- Amanda