I just got a Keybow Mini from Adafruit. I assembled it, gave it a try, and I’m hitting unexpected behavior.
I downloaded the firmware version 0.0.4 from the keybow github repo.
I added the mini setup call to the default layout and updated the key handlers to use minikey
instead of just key
:
require "keybow"
function setup()
keybow.use_mini()
end
-- Standard number pad mapping --
-- Key mappings --
function handle_minikey_00(pressed)
keybow.set_key("0", pressed)
end
function handle_minikey_01(pressed)
keybow.set_key(".", pressed)
end
function handle_minikey_02(pressed)
keybow.set_key(keybow.ENTER, pressed)
end
function handle_minikey_03(pressed)
keybow.set_key("1", pressed)
end
function handle_minikey_04(pressed)
keybow.set_key("2", pressed)
end
function handle_minikey_05(pressed)
keybow.set_key("3", pressed)
end
function handle_minikey_06(pressed)
keybow.set_key("4", pressed)
end
function handle_minikey_07(pressed)
keybow.set_key("5", pressed)
end
function handle_minikey_08(pressed)
keybow.set_key("6", pressed)
end
function handle_minikey_09(pressed)
keybow.set_key("7", pressed)
end
function handle_minikey_10(pressed)
keybow.set_key("8", pressed)
end
function handle_minikey_11(pressed)
keybow.set_key("9", pressed)
end
When I did this they LEDs on all of the keys work fine, but I couldn’t get any of the key presses past index 2 to work. They keystrokes just don’t register.
I then enabled the mini
layout with the rest of the keys mapped:
require "keybow"
-- Keybow MINI --
function setup()
keybow.use_mini()
keybow.auto_lights(false)
keybow.clear_lights()
end
-- Key mappings --
function handle_minikey_00(pressed)
keybow.set_key("0", pressed)
if pressed then
keybow.set_pixel(0, 255, 0, 0)
else
keybow.set_pixel(0, 0, 0, 0)
end
end
function handle_minikey_01(pressed)
keybow.set_key("1", pressed)
if pressed then
keybow.set_pixel(1, 0, 255, 0)
else
keybow.set_pixel(1, 0, 0, 0)
end
end
function handle_minikey_02(pressed)
keybow.set_key("2", pressed)
if pressed then
keybow.set_pixel(2, 0, 0, 255)
else
keybow.set_pixel(2, 0, 0, 0)
end
end
-- From here down I added the rest of the key mappings missing from the mini example
In this case I still don’t get keystrokes past index 2, but also when I push key index 0 the LED for key index 1 lights up.
keybow not working past index 2
To try to isolate the issue to the board vs the keys I popped off the keys and mounting board and tried moving some of they keys that were unresponsive to keypress to the indexes that were working and vice versa. The problem follows the indexes in the circuit board because keys that were not working in indexes 3 and up would work fine in index 0, 1, and 2. Keys that worked in 0, 1, and 2 didn’t work in the other indexes.
I also created a layout where I tested out lighting each of the LED indexes from a known good key. This one was odd because I know all of the LEDs work when I let the auto_lights run, but when I press key 0 I can’t get any of the LEDs to light up from the set_pixel method past index 3.
I’m pretty sure I have a bad circuit board, but this is also my first time diving into the codebase and the first time I’m using lua, so I’m not sure if maybe I’m doing something or misunderstanding something at the code level.
Here’s the link to the version of the codebase I’m loading onto the keybow if that helps clue anyone in to a snag that I’m not seeing: GitHub - chris-schmitz/cs-keybow: My keybow codebase with custom mappings
Any help is greatly appreciated!