Arcade board: how do I configure buttons?


#1

Hi, I did purchase some time ago an arcade board from Adafruit, so I could make my own cabinet.

I did install the wires and made the right solder joints, although I don’t understand how to change what button is assigned to what. The joystick directions works in any emulator so far; but the button does not. In some MAME arcade for example; I see that the buttons pressed are “x” “return”, “s”, “c”, “z” and some other that I can’t really figure out, since I don’t get a print out when I press them.

This is particularly problematic since most of the arcade works with different buttons combination, and I end up having a ton of emulators where I have to use a keyboard too; which is not really useful when you have the computer in a cabinet.

Is there a way to re-program the buttons on the board itself? I assume that working as HID USB device, it should have some code that tell the board what ascii code to send to each of the output.

Thanks!


#2

Does this help, https://learn.adafruit.com/adafruit-arcade-bonnet-for-raspberry-pi/software


#3

Thanks; this is good for the PI, although my cabinet is based on a very old Windows computer; that I had laying around.

Could this be applied to windows too?

I did find an old post (2015) that mention that the Picade can be plugged via USB and recognized as Leonardo by the Arduino IDE. Is this still the case; so I can basically flash it as I would do with an Arduino? In that case I can get the sketch from the github repo and use that? I don’t want to make a mess with the original firmware, unless I know what am I doing. Thanks!


#4

I have no idea. I have never owned a Picade etc. It’s one of those wish I had one, juts never bought one. I buy a lot of stuff from Adafuit so I had a quick look see in the Learn section.


#5

If you’re using a Picade PCB (not HAT) then this guide might help: New 2.x Configurable Keyboard/Gamepad Firmware

If you’re using the HAT then you need to tweak the keybindings in /usr/bin/picadehatd, see: https://github.com/pimoroni/picade-hat/blob/master/daemon/usr/bin/picadehatd#L63-L78


#6

Thanks, as mentioned before I am using the PCB version; so this should work.

Although I do not understand how do you access the board itself; when I connect it to the USB on my computer, it does not show up. So I am not sure how do I follow the instructions. Same goes for the firmware…how do I install it on the device, if I can’t see it?


#7

Are you using a Raspberry Pi or a PC as the brains of your arcade build?

If you’re using a PC the easiest way to set it up is to install the Arduino IDE, use that to install the firmware and then the Serial Monitor to talk to the board- you can configure it by sending the commands as listed in the configurable firmware link.

If you’re using a Pi, you can just use the updater available here: https://github.com/pimoroni/Picade-Sketch/tree/master/update

And then talk to the board with (hopefully this is correct):

sudo apt install screen
screen /dev/ttyACM0 115200

Once you’re done you can quit screen with Ctrl+A Ctrl+Z


#8

I am using a W10 machine for the main system.

Got the Picade board so I don’t have to worry about anything on the controls setup; and with 6 buttons plus extras, is perfect for my needs (not planning to use the arcade cabinet for games that require analog; for that I use my desk pc and the Xbox360 controller).

When it is plugged in, I see it as Leonardo keboard, so can’t do much with it, but I see also that arduino IDE see it on COM4; so that means that I can modify the INO file and re-upload it on the board? I am not keen on sending to the board anything that is not kosher.

Could you please point me to the correct repo for the firmware to upload via Arduino IDE? The original is in one place, while there is also a 2.x available; I assume either is fine? Thanks!


#9

There’s no need to modify the firmware, just upload it as-is and then configure it via the Serial Monitor.

When you upload the firmware to the board, you’re talking to the bootloader anyway- so even if you upload something that’s not quite right, you can easily just upload again.

The source is this folder and its contents: https://github.com/pimoroni/Picade-Sketch/tree/master/Picade

Just make sure you select Arduino Leonardo from the boards menu in the Arduino IDE.


#10

I see; I did upload it successfully via Arduino IDE, although modifying the values in the sketch seems to not have any effect. I will try the serial approach now; if only I can get Putty to connect to it (it just hang when I try the serial port used by Arduino IDE: COM8).

This is what I did change:
#define DEBOUNCE_DELAY 25

const uint8_t picade_pins[] = {UP, DOWN, LEFT, RIGHT, BTN_1, BTN_2, BTN_3, BTN_4, BTN_5, BTN_6, START, COIN, ENTER, ESCAPE, VOL_UP, VOL_DN, MOSI, MISO, SCLK};

const uint8_t quickbind_keyboard[] = {KEY_UP_ARROW, KEY_DOWN_ARROW, KEY_LEFT_ARROW, KEY_RIGHT_ARROW, KEY_LEFT_CTRL, KEY_LEFT_ALT, ' ', KEY_LEFT_SHIFT, 'z', 'x', 's', 'c', KEY_RETURN, KEY_ESC, ACT_VOL_UP, ACT_VOL_DN, 'i', 'o', 'p'};

And also this:

/* Change key bindings below */
picade_config default_config = {
  CONFIG_VERSION,
  {
    {KEY_UP_ARROW},
    {KEY_DOWN_ARROW},
    {KEY_LEFT_ARROW},
    {KEY_RIGHT_ARROW},
    {KEY_LEFT_CTRL},
    {KEY_LEFT_ALT},
    {' '},
    {KEY_LEFT_SHIFT},
    {'z'},
    {'x'},
    {'1'},
    {'5'},
    {KEY_RETURN},
    {KEY_ESC},
    {ACT_VOL_UP},
    {ACT_VOL_DN},
    {'i'},
    {'o'},
    {'p'}
  },
  0, // Shift State
  VOL_DEFAULT
};

But neither change seems to have effect, after building and uploading to the PCB.


#11

Thanks a lot for all the help! Using serial com via Arduino IDE serial monitor I was able to change button config.

I was expecting was faster to change them in the INO file but none of my changes were taken. It works now so problem solved. Thanks again!


#12

Possible that if you had the same version of the configurable firmware loaded, it would already have saved the Default Config into EEPROM and would have loaded that saved copy instead of the baked-in fallback.

If you’re more comfortable editing the Arduino project you might get away with bumping the version number to trick it into loading the new default config.

Glad you’re up and running, though!