Raspberry Pi Pico 电容式触控
- shaoziyang
- 帖子: 3972
- 注册时间: 2019年 10月 21日 13:48
Raspberry Pi Pico 电容式触控
这些是该项目中使用的主要概念的关键教程:
原理图
电路
- shaoziyang
- 帖子: 3972
- 注册时间: 2019年 10月 21日 13:48
Re: Raspberry Pi Pico 电容式触控
CircuitPython 参考代码
https://diyelectromusic.wordpress.com/2 ... ive-touch/
代码: 全选
import board
import touchio
from adafruit_debouncer import Debouncer, Button
THRESHOLD = 1000
t = touchio.TouchIn(board.GP12)
t.threshold = t.raw_value + THRESHOLD
touchpad = Button(t, value_when_pressed=True)
while True:
touchpad.update()
if touchpad.rose:
print("Touch On")
if touchpad.fell:
print("Touch Off")
-
- 随机主题
- 回复总数
- 阅读次数
- 最新文章
-
- 9回复总数
- 1240 阅读次数
- 最新文章 由 czfx
2022年 6月 3日 22:11
-
- 15回复总数
- 2623 阅读次数
- 最新文章 由 shaoziyang
2022年 7月 6日 17:06
-
- 1回复总数
- 2519 阅读次数
- 最新文章 由 shaoziyang
2022年 6月 3日 19:25