I’m trying to get the Keybow Mini working with a Pi Zero W which has bare metal CircuitPython on it. I’m currently using a 9.0.0 beta of CircuitPython but have the same issues with the latest stable version 8.2.5 also so that shouldn’t be the problem.
According to Keybow Mini at Raspberry Pi GPIO Pinout the GPIO pins used for the keys are 6, 17 and 22. In the first step I just want the keys working but I only managed to make Key 3 (Pin 6) working as expected.
This is my code I used for testing the keys:
import board, digitalio, time
button = digitalio.DigitalInOut(board.D6) #works
#button = digitalio.DigitalInOut(board.D17) #doesn't work
#button = digitalio.DigitalInOut(board.D22) #doesn't work
button.switch_to_input(pull=digitalio.Pull.UP)
#button.switch_to_input(pull=digitalio.Pull.DOWN)
print("initial value: " + button.value)
while True:
if (not button.value):
print("button pressed")
else:
print("button not pressed")
time.sleep(0.1)
When I tried the different buttons/pins I realized that the initial value for pin 6 is “True” and for 17 + 22 is “False” so I tried switching the pull-mode from UP to DOWN but this didn’t work either for these two pins. On the other side for pin 6 both pull-modes work so I guess this isn’t the problem either.
I also switched the mechanical switches around to eliminate any possible faults there.
I’m scratching my head for a while now and I just have no idea what I’m missing here to get all keys functioning. Does anyone have any idea what I need to do?
I reattached the HAT a couple of times also. I only thing I didn’t do was using another pi. But as I used this one in other projects recently I don’t think it is damaged or something.
Have you verified that the keybow is working fine if you install the standard software from Pimoroni? Just to rule out hardware-problems on the keybow.
Bare-metal CircuitPython is afaik still very experimental. So if the hardware performs fine, I would not rule out problems with CP here.
I now tried using the KeybowOS and… It worked! The keys are working and the LEDs also. I set up some keybindings and macros and everything worked as expected.
On one hand this is great news as the board itself is totally fine but on the other side this is some kind of bummer as I still don’t know whether my code is faulty and I’m missing something or if CircuitPython itself is the problem here… :(