Pololu Robotics & Electronics
Menu
My account Comments or questions? About Pololu Contact Ordering information Distributors

Pololu Forum

Does thee QTR library work with port extenders?

Hello as QTR sensors has variations that contains up to 31 sensors, there are few microcontrollers that can handle this amount of pins. So it sometimes wise to use port expanders such as the MCP23S17 that communicates via SPI to your microcontroller. This is great as it will greatly reduce the pins used.

Now for my question; Will the QTR library still work if the pins are read via SPI? Basing from the functions that are posted it would seem not. Are there any work around to this using this method? Although writing my own code based on the functions is possible, but i thought to ask first just incase that the creators thought of this.

Thank you very much!

Hello.

I would not expect the QTR library to work with a port extender without modifications, so you could try modifying the existing library or writing your own code from scratch. You can find explicit details on how to read the QTR sensors properly in the QTR reflectance sensor application note.

- Amanda