Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 6 of 6

Thread: Please consider adding a library page for touchRead

  1. #1
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,271

    Please consider adding a library page for touchRead

    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.

  2. #2
    Senior Member
    Join Date
    Dec 2014
    Posts
    262
    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?

  3. #3
    Can I use a touchRead() on a pin, and use it as an IO pin?

  4. #4
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,535
    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.

  5. #5
    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?

  6. #6
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,535
    Quote Originally Posted by Polymorph View Post
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •