my current project is to build a line-following robot. I bought some reflectance sensors from QTI, and so far, I have them working by simply reading the analog output.
It works on well lit area, but i start having issues when there’s too much shadows (the difference in readings between a black line and a white paper becomes inexistant).
So, i read a bit of documentation and saw another way of doing it by using digital port instead :
- Set the port to OutputPort, and to High,
- wait for the condensator to charge (230 microseconds in my case)
- set the pour to InputPort,
- check how long it takes for the port to read “false” instead of “true”.
My questions are :
1 - If I am to do that, I need to dynamically change the port mode. Is there any way to do that, or should I “dispose and recreate” ?
2 - If anyone has any experience in this, would that methode be more efficient than direct readings to analog port like i am currently doing?
3 - Given the time involved (hundreds of microseconds), is a microcontroller based on the .Net framework the best choice, or should i use a more “low-level” controller?
Thanks in advance for your answers.