It looks like in order to get our QTR library working with a Teensy, you will need to modify the QTRSensors.cpp file. This is because the ARM microcontrollers do not handle commands in exactly the same way AVR microcontrollers do. In particular, every time the code tries to command
digitalWrite() right before
pinMode(), you should swap the order of the two commands. For example, lines 434 and 435 show:
digitalWrite(_pins[i], HIGH); // make sensor line an output pinMode(_pins[i], OUTPUT); // drive sensor line high
and should, instead, be:
pinMode(_pins[i], OUTPUT); // drive sensor line high digitalWrite(_pins[i], HIGH); // make sensor line an output
It looks like this happens two more times inside QTRSensors.cpp: lines #114 and #123.
By the way, I just realized that your Teensy LC uses 3.3V logic and its pins are not 5V-tolerant. From your connections, it looks like you are powering the QTR-1RC with 5V from the Teensy. This is risky since OUT could then be 5V, which could permanently damage the I/O pin it is connected to on the Teensy LC. Instead, you might consider connecting the QTR’s 3.3V to VCC to power the QTR-1RC. This will make it safer to connect to your Teensy LC’s I/O, but it will also reduce the brightness of the IR LED. Alternatively, you might consider using a level-shifting circuit like this one.