Hi everybody,
I understand that the ReSpeaker 4-Mic-Array for Raspberry Pi has two Grove ports for GP12 (mapped to GPIO 12 and 13) and I2S. As I want to build an voice assistant I wanted to pin a button to the GP12 port in order to disable the mic, etc. I bought an Grove Button with the official cable but I’m unable to read the button state. I tried to listen on both GPIO ports (using Python gpiozero
but also using the Linux kernel userland, it works with conventional buttons so it is not an OS/Hardware issue I assume) and also tried the grovepi
and grove.py
examples from GitHub - without any success. Am I missing something here?
Here’s my latest code:
import time
import grovepi
# Connect the Grove Button to digital port D3
# SIG,NC,VCC,GND
button = 12
grovepi.pinMode(button,"INPUT")
while True:
try:
print(grovepi.digitalRead(button))
time.sleep(1)
except IOError:
print ("Error")
Any hints are welcome - thanks a lot in advance!
Best wishes,
Christian.