Please consider adding a library page for touchRead

MichaelMeissner

Senior Member+
I was posting to a disabled gamer on the arduino.cc forum, and I was suggesting he might think about using the touch sensors on the Teensy 3.0/3.1. However, I couldn't find an entry for it in the Teensy library page (http://www.pjrc.com/teensy/td_libs.html). I pointed him to the threads I've read in the past about touchRead, but it would be nice to have a library page for it.

When the audio library goes out of beta, it would be nice to have an official page for that as well.
 
We still don't have this documentation! What pinMode() does touchRead() need? How fast is it? What are typical values returned? Should I code in an absolute value, or try to detect big changes?
 
No, either IO or touch read. In opposite to the cheap and simple RC-via-IO method on older AVR processors, the Teensy 3.x processors have a dedicated and sophisticated internal TSI engine which can measure fractions of a pF in touch capacitance. When you invoke the touchRead function, the selected pin is internally disconnected from GPIO and connected to the TSI through the internal pin multiplexer. When touchRead has finished, you might (if you do not intend to do continuous or repeated touch detection) invoke pinMode which links the pin back to GPIO.
 
Well... then the answer is yes, I can use a pin for both. Of course I don't mean at the same time. I mean within a program, I can use a pin as an IO pin, then with touchRead(), then as an IO pin, etc.

As expected, I would invoke pinMode to use a pin as an IO pin after using it with touchRead().

Is an entry on the library page planned?
 
Is an entry on the library page planned?

Can't tell, I'm not a PJRC official, just a volunteer. But basically, since touchRead() has become a core function and does not need any library, the library page could be the wrong place. Best documentation are the TSI chapter of the reference manual and Paul's comments in the source code of touch.c
 
Back
Top