I’ve pushed a new firmware binary to GitHub which includes the following changes:
- Alt1 / Alt2 modifier keys to support soft switching, with independent toggle/hold choices for each
- Volume Up/Down control over serial using commands + or -
- Gamepad Z axis, just in case you can’t get enough axis
- Minor bugfixes and tweaks
An example binding for n64 support is:
a 220 221 222 223 230 231 232 233 234 235 236 237 253 239 240 252 0 0 0 0 0 0 0 0 242 243 0 244 245 0 0 0 0 0 0 0 0 0 250 251 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
This sets the gamepad up on all buttons, the 4 right-most buttons on the top become alternate gamepad buttons when holding the left-side front-most button. When holding the right-side front-most button the joystick becomes vol up/down.
Note: I’ve been testing this in Mupen64plus, ran across PEBKAC errors and eventually got it working by reading the manual. Whee!
I tried sdl-jstest from here ( GitHub - Grumbel/sdl-jstest: Simple SDL joystick test application for the console ) to confirm buttons were being read- it works fine in SDL 1.2, but for some completely insane reason SDL 2.0 emits console warnings about not supporting certain keycodes whenever a Picade Gamepad button is hit.
I’ve put together a firmware which makes the Picade PCB pretend to be a 2 axis, 16 button HID gamepad in addition to a keyboard. We demoed it ( sort of ) on BilgeTank:
You can dynamically map Picade buttons to either gamepad axis/buttons, keyboard keys or volume control.
This may or may not be useful to users looking to get the Picade working with the N64 emulator, which doesn’t appear to readily accept keyboard input.
You can find it named picade_2016.hex
in the Picade firmware update folder on GitHub: https://github.com/pimoroni/Picade-Sketch/tree/master/update
I have improved the update
script so you can simply run:
./update picade.hex
(Note this used to be ./update picade_2016.hex
, but the configurable firmware is now stable and part of the regular release.)
And everything should be taken care of.
Editing the config with Python
The easy way!
You can load a config dump easily Python using PySerial, which is auto-installed by the Picade updater ( to reset the Picade ):
import serial
picade = serial.Serial('/dev/ttyACM0',9600,timeout=1.0)
picade.write("a 218 217 216 215 128 130 32 129 122 120 115 99 176 177 250 251 105 111 112")
print(picade.readline().strip())
Or you can use the picade.py
library available here: https://github.com/pimoroni/Picade-Sketch/tree/master/Config
import picade
picade.bind([picade.GAMEPAD_UP, picade.GAMEPAD_DOWN, picade.GAMEPAD_LEFT, picade.GAMEPAD_RIGHT])
Editing the config manually
The painful way!
When you connect to the new firmware over serial at 9600 baud, you can send commands to rebind the keys and all sorts of other goodness. At the moment this is most easily accomplished using the Serial Monitor in the Arduino IDE or in PuTTY using “Local Line Editing” and “Local Echo” which you can find in the options under “Terminal”.
Commands are as follows:
h
- List all available buttons and actions
b <button> <keycode>
- Bind a button ( from 0 to 18 ) to a specific action
a <keycode> <keycode> ...
- Bind all keys, or any number of keys, in order ( up to 19 values )
d
- Dump current binding
s
- Save current config to EEPROM
l
- Load config from EEPROM, replacing current config
k
- Load a quick keyboard preset ( picade defaults )
g
- Load a quick gamepad preset
When you type h
you’ll see something like this:
Buttons are the joystick axis and buttons on the Picade. MOSI, MISO and SCLK being the 3 additional pins on the 6-pin programming header which you can use with a bit of hackery.
Keycode can map to either a gamepad axis, a gamepad button or an action like volume up/down.
<button> should be one of:
0 = Joy U 1 = Joy D 2 = Joy L 3 = Joy R
4 = Btn 1 5 = Btn 2 6 = Btn 3 7 = Btn 4 8 = Btn 5 9 = Btn 6
10 = Start 11 = Coin 12 = Enter 13 = Escape
14 = Vol Up 15 = Vol Down
16 = MOSI 17 = MISO 18 = SCLK
<keycode> should be one of:
220 = Gpad U 221 = Gpad D 222 = Gpad L 223 = Gpad R
230 = Gpad 0 231 = Gpad 1 232 = Gpad 2 233 = Gpad 3
234 = Gpad 4 235 = Gpad 5 236 = Gpad 6 237 = Gpad 7
238 = Gpad 8 239 = Gpad 9 240 = Gpad 10 241 = Gpad 11
242 = Gpad 12 243 = Gpad 13 244 = Gpad 14 245 = Gpad 15
250 = Volume Up 251 = Volume Down
218 = U Arrow 217 = D Arrow 216 = L Arrow 215 = R Arrow
128 = L Ctrl 129 = L Shift 130 = L Alt 131 = L GUI
132 = R Ctrl 133 = R Shift 134 = R Alt 135 = R GUI
178 = Backspc 179 = TAB 176 = Return 177 = ESC
209 = Insert 212 = Delete 211 = Pg Up 214 = Pg Down
210 = Home 213 = End 193 = Caps Lk 13 = Space
194 = F1 195 = F2 196 = F3 197 = F4
198 = F5 199 = F6 200 = F7 201 = F8
202 = F9 203 = F10 204 = F11 205 = F12
33 = ! 34 = " 35 = # 36 = $
37 = % 38 = & 39 = ' 40 = (
41 = ) 42 = * 43 = + 44 = ,
45 = - 46 = . 47 = / 48 = 0
49 = 1 50 = 2 51 = 3 52 = 4
53 = 5 54 = 6 55 = 7 56 = 8
57 = 9 58 = : 59 = ; 60 = <
61 = = 62 = > 63 = ? 64 = @
65 = A 66 = B 67 = C 68 = D
69 = E 70 = F 71 = G 72 = H
73 = I 74 = J 75 = K 76 = L
77 = M 78 = N 79 = O 80 = P
81 = Q 82 = R 83 = S 84 = T
85 = U 86 = V 87 = W 88 = X
89 = Y 90 = Z 91 = [ 92 = \
93 = ] 94 = ^ 95 = _ 96 = `
97 = a 98 = b 99 = c 100 = d
101 = e 102 = f 103 = g 104 = h
105 = i 106 = j 107 = k 108 = l
109 = m 110 = n 111 = o 112 = p
113 = q 114 = r 115 = s 116 = t
117 = u 118 = v 119 = w 120 = x
121 = y 122 = z 123 = { 124 = |
125 = } 126 = ~
A complete dump of the default keyboard config looks like:
a 218 217 216 215 128 130 32 129 122 120 115 99 176 177 250 251 105 111 112