xmc 1100 line follower

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hello!
I want to do a line follower robot, but I have a problem in Dave 4.2.4! How can i read the values of two QTR-1A Reflectance Sensor? I mean what the code should be? Please help me!!!
0 Likes
5 Replies
Not applicable
HI,

I think you should be able to read the pins using the DIGITAL_IO APP and make decision based on these pins.

Regards,
Daryl
0 Likes
Andi_H
Employee
Employee
First solution authored First like received
You have to use the ADC Messurement App (if you are using a DAVE Project)

And read the app help (how to use the API´s)
0 Likes
Not applicable
I have tried this, but it doesn't work.
0 Likes
Not applicable
HI,

Andi_H is correct, probably the ADC_Measurement APP is a better fit for this since an analog value is returned to the pin.

There's an example in the APP Help-> Usage section that teaches you to set up an ADC channel. Just to be sure that you are able to correctly get ADC working, make sure you get the example working before moving onto your Reflectance Sensor.

Regards,
Daryl
0 Likes
Adrian_C
Employee
Employee
Hi!

You can use a comparator as an interface between sensors and microcontroller (LM324, LM339). In this way you can use the pins as digital inputs.

Also, you can set the comparator threshold using a variable resistor for different surfaces without any change into your code.

BR,
Adrian
0 Likes