I recently acquired my input board from kitsch-bent, i2c version.
I finally got this to work and now I hope this guide can help anyone that wanted to use this board !
Foreword:
Maybe I should have looked at these threads before buying.
As my first DIY/electronics project, this board wasn't the easiest to figure out
My choice for this board was because I didn't want to use the gameboy main board but still felt like the project wouldn't be as fun if I bought one of the board that already have everything pre-built in them (USB hub, teensy etc.).
I also wanted to experiment with buttons straight on the raspberry pi so this board looked perfect for just this!
A few obstacles were on the way, including the mk_arcade_joystick_rpi driver that has had a bug for almost a year now, which basically ignored the MCP23017...
I'm a programmer and I had a lot of fun writing a python program to test i2c communication with my board, remapping the keys in the driver and finally debugging and fixing the MCP23017 bug. Now to the guide!
The Guide:
Prerequisite:
a shell to your raspberry pi with root/sudo rights (follow this tutorial to enable ssh)
Wiring the board
Connect each pin to your raspberry pi (I'm using 3.3V as Vcin because it's closer but you can use 5V).
MAKE SURE YOUR WIRING IS CORRECT BEFORE TURNING ON THE RASPBERRY PI
Connect to your board:
Enable i2c and install everything needed (I followed this adafruit tutorial)
If your board is properly connected, you should see it on "port" 20
Code: Select all
sudo i2cdetect -y 1
Test your buttons:
I made this python script to figure out the button key codes on the board. You can use it to make sure all your buttons are working before you try installing a driver for the board.
Code: Select all
wget https://gist.githubusercontent.com/vizigr0u/5308bef88934967b687ca6921846f49b/raw/72aef1d19d47280b646ae63538d6c982e3046f62/i2ctest.py
python i2ctest.py
Install an input driver:
Unfortunately, as the time of writing, the mk_arcade_joystick_rpi driver has a bug for MCP23017. It also doesn't have the right mapping for the Kitsch-Bent board.
So I went ahead and forked that repo and made a version that both fixes the bug and uses the Kitsch-Bent inputs here.
(appologies to kitsch-bent, at the time of coding I was certain your name was Kitsch Bench )
I also compiled it and uploaded a debian package to my github.
Anyway, to install a version of my driver on your raspberry pi:
Method A (easy and untested) :
Code: Select all
wget https://github.com/vizigr0u/mk_arcade_joystick_rpi/releases/download/v0.1.5b-0-1/mk-arcade-joystick-rpi-0.1.5.deb
sudo dpkg -i mk-arcade-joystick-rpi-0.1.5.deb
compiling from source :
Code: Select all
git clone https://github.com/vizigr0u/mk_arcade_joystick_rpi.git
cd mk_arcade_joystick_rpi
git checkout git checkout kitsch-bench-board
make
sh utils/makepackage.sh 0.1.5
sudo dpkg -i build/mk-arcade-joystick-rpi-0.1.5.deb
Code: Select all
sudo dpkg -r mk-arcade-joystick-rpi-dkms
Testing the driver (final step!) :
Let's start the module, then test it!
Code: Select all
sudo modprobe mk_arcade_joystick_rpi map=0x20
jstest /dev/input/js0
Add mk_arcade_joystick_rpi to your /etc/modules file
Code: Select all
echo mk_arcade_joystick_rpi | sudo tee -a /etc/modules
Code: Select all
echo options mk_arcade_joystick_rpi map=0x20 | sudo tee /etc/modprobe.d/mk_arcade_joystick_rpi.conf