A lot of confusion with the touch pins on the Teensy boards

Hello. I think there is some confusion around the web regarding the touch pins on the teensy boards and how to use them. As of now there's (to my knowledge) only a few places to get a correct understanding of how to use the touch pins:
  • The pin out cards that comes with the teensy, and I would argue that it might not be clear for a beginner that the text in the colored sections refers to functions or libraries. This assumes a user sees the mention of for example digitalRead in the grey section, understands this refers to the arduino function digitalRead() and then draws the conclusion that the touchRead in the yellow section must refer to a (to them unknown) function called touchRead().
    card7a_rev1.png
  • This very forum where you can read several pages of people discussing how to use the touchRead function.

On top of this there are these pages on the pjrc website:
  • https://www.pjrc.com/teensy/td_libs_CapacitiveSensor.html
    This page describes the CapacitiveSensor.h library written by Paul Badger (which has nothing to do with the touch pins on the Teensy). I think it can be rather misleading for readers to stumble on this. They could easily mix up the use of the library and the touchRead function (I actually did that myself a few years back when starting out using teensy). Perhaps it would be good to make a disclaimer in the top of this page?
  • https://www.pjrc.com/capacitive-touch-tutorial/
    This page on the pjrc blog links to a very misleading tutorial which makes this very mistake and bases a whole tutorial on this false presumption (that on must use the library to interface the touch pins)

Optimally I think would be good to make an official instruction somewhere on the PJRC website on how to use the touch pins.
 
@Gunnar, you are absolutely correct. I recently went thru the same learning curve. Those pages you referenced are probably still valid for Arduino and older versions of Teensy. Since you are showing what appears to be a Teensy 3.1/3.2 info card, I'll share my experience related to the newer versions of Teensy.

Code:
p1=touchRead(pad1);


is all I used to readout the touchPad value. Use of two pins and a few resistors is no longer required.
 
Back
Top