将按钮连接到 V2 AIY 语音引擎盖上的 GND 和 PIN_D 和代码:
from gpiozero import Button
from signal import pause
from aiy.pins import PIN_D
button = Button(PIN_D)
button.wait_for_press()
print("The button was pressed.")
pause()
我收到消息:
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/usr/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "/home/pi/AIY-projects-python/src/aiy/pins.py", line 475, in _poll
callback()
TypeError: _pin_changed() missing 2 required positional arguments: 'ticks' and 'state'
任何有关下一步尝试的建议将不胜感激。