I’m doing a project but I can’t read QTR8A sensors. Please help me. I use programming language Micro C .How to use read ?
I use pic 16f877a . QTR8a connection AN ports.
AN0,AN1,AN2… 8 sensors.
First of all , read left sensor 1 and port b2 high
if active left 1 sensor , port b 2 high
another example , if active   sensors active , port b2 and port b3 high
Line follower project.
please help me .
It is difficult to help you troubleshoot the issue without knowing more about your setup. From your description, it looks like you are expecting the sensors on the QTR-8A to output a HIGH or LOW signal. The QTR-8A outputs an analog voltage signal for each sensor, which can be read directly from analog pins. It might be helpful for you to look at the Arduino examples for the QTR-xA sensors. You can find those examples under the “examples” directory on the “Arduino Library for the Pololu QTR Reflectance Sensors” GitHub page. Also, I recommend looking at the “Arduino Library for the Pololu QTR Reflectance Sensors” user’s guide, in particular the
readLine function description. The
readLine function uses the sensor readings to determine where the line is. This could give you some idea of how to implement that functionality in your program.
If you continue to have trouble with your code, you could post it here.
I don’t use arduino . I use pic . Pic16f877a. I use program micro c or jalwin. Maybe I use adc. Help me
Although the examples and the user’s guide that I linked in my previous post are specific to the Arduino, both resources can help improve your understanding of how to read from the QTR-A sensor and use its readings to determine your position with respect to the line. The Arduino library for the QTR-xA sensors is written in C++, so you could rewrite the code in C for your PIC16F877A if you looked at it.
If you have written code and it does not work as expected, can you post it here? Can you also post the output you get when you try reading from the sensors? If you have trouble converting the logic from one language to the other, you might consider posting your question on the MikroC forum so that your issue can reach a larger community .