My code (pulled from the tutorial):
Code: Select all
import time
import board
import touchio
touch_pad = board.A2
touch = touchio.TouchIn(touch_pad)
while True:
if touch.value:
print("Touched!")
time.sleep(0.05)
Code: Select all
Traceback (most recent call last):
File "code.py", line 6, in <module>
ValueError: No pulldown on pin; 1Mohm recommended
- CircuitPython 7.1.0
- Mac, running Big Sur
- Mu editor, connected over USB
EDIT: I can verify it does work using a 1M ohm resistor between the pin and ground.