С помощью кнопки, подключенной к GND и PIN_D для V2 AIY Voice Bo nnet и кода:
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'
Любые предложения о том, что попробуйте следующий будет очень ценится.