I'm converting a Sinclair Spectrum 128 ZX +2 into a Raspberry Pi-powered computer and I'm using a Teensy 3.2 USB Development Board for mapping the original keyboard with the original membrane and get a normal USB keyboard. I'm not planning to maintain the original key mapping, probably I'll buy some stickers and I'll convert it in a UK keyboard.
I've reused the original ribbon connectors in this way:
(I noticed the disconnected cables after I took the photo, now fixed)
I've found a Teensy code for something similar online (thanks Chad Boughton) and I've tried to adapt it for the Sinclair, the first attempt was to simply check if all the keys were working.
Here the code: https://gist.github.com/federicocappelli/7f61d6bc2095cbc278df12519b721435
Briefly, I've created a fake keys matrix:
const byte ROWS = 5;
const byte COLS = 8;
char keys[ROWS][COLS] = {
{KEY_1,KEY_2,KEY_3,KEY_4,KEY_5,KEY_6,KEY_7,KEY_8},
{KEY_9,KEY_0,KEY_A,KEY_B,KEY_C,KEY_D,KEY_E,KEY_F},
{KEY_G,KEY_H,KEY_I,KEY_J,KEY_K,KEY_L,KEY_M,KEY_N},
{KEY_O,KEY_P,KEY_Q,KEY_R,KEY_S,KEY_T,KEY_U,KEY_V},
{KEY_W,KEY_X,KEY_Y,KEY_Z,KEY_ENTER,KEY_TILDE,KEY_DELETE,KEY_BACKSPACE}
};
byte rowPins[ROWS] = {1,2,3,4,5}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {6,7,8,9,10,11,12,13}; //connect to the column pinouts of the keypad
But the result is not what I was expecting, for instance, pressing
12345678
5cs
6d4b
I expected 1 character for one keypress. What I am doing wrong?
Here the Sinclair service manual with the keyboard membrane explanation
if you're still interested by this topic,
I wrote a code to handle the ZXSpectrum+ specific Keyboard (compared to Legacy Spectrum) with an Arduino MICRO MCU.
only SYMBOL+A combo does still not work
based on the PDF that you sent... ZXKeyb with arduino micro