Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

TouchIO on Itsy Bitsy M4
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

TouchIO on Itsy Bitsy M4

by MrCoxall on Tue Apr 14, 2020 3:14 pm

I am trying to use the touchio library on an Itsy Bitsy M4.
I am following this guide:
https://circuitpython.readthedocs.io/en/5.0.x/shared-bindings/touchio/__init__.html

And running this code:
Code: Select all | TOGGLE FULL SIZE
import touchio
from board import *

touch_pin = touchio.TouchIn(A2) #changed this to A2 for my board
print(touch_pin.value)


I am getting the following error:
File "code.py", line 4, in <module>
ValueError: No pulldown on pin; 1Mohm recommended

I am not exactly sure how I place the 1M ohm resistor, in relation to a wire attached to A2 that I am using as my touch pad.
Anyone have a diagram?

Thanks

MrCoxall
 
Posts: 8
Joined: Thu Oct 03, 2019 11:16 am

Re: TouchIO on Itsy Bitsy M4

by tannewt on Tue Apr 14, 2020 4:56 pm

I believe you just connect your touch pad to ground via the resistor. The purpose is to slowly drain the charge out of the pad. touchio measures the time it takes to go low after the MCU sets it high. A nearby finger influences the amount of charge held and therefore the time it takes to drain via the resistor.

tannewt
 
Posts: 1685
Joined: Thu Oct 06, 2016 8:48 pm

Please be positive and constructive with your questions and comments.