Raspberry Pi Pico 电容式触控
- shaoziyang
- 帖子: 3980
- 注册时间: 2019年 10月 21日 13:48
Raspberry Pi Pico 电容式触控
这些是该项目中使用的主要概念的关键教程:
原理图
电路
- shaoziyang
- 帖子: 3980
- 注册时间: 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")
-
- 随机主题
- 回复总数
- 阅读次数
- 最新文章
-
- 4回复总数
- 2970 阅读次数
- 最新文章 由 dexter
2020年 4月 22日 12:37
-
- 1回复总数
- 3144 阅读次数
- 最新文章 由 shaoziyang
2020年 4月 22日 16:49
-
- 4回复总数
- 3058 阅读次数
- 最新文章 由 slotg
2020年 4月 23日 10:52