Hi everyone.
First of all, thank you for taking the time to read my post. About a month ago I didn't know anything about circuits, arduino, coding or even pcb's, so please, bear with me if I make mistakes explaining the issue Im experiencing.
Im trying to make a macropad with keyboard switches, a 4x6 matrix connected to a Seeed Xiao RP2040. I used a Youtube video as inspiration but I did some changes based on my needs. This was just increasing the number of keys.
I managed to make it work partially. This is only 4 of the 22 keys are responsive, but even these keys are not working properly.
I will provide now schematics and details of what I managed to get done and at the end I will provide details of the issue Im experiencing.
Schematics of the circuit:
Specs of the Seeed Xiao RP2040: Getting Started with Seeed Studio XIAO RP2040 | Seeed Studio Wiki
Link to it's Datasheet : https://files.seeedstudio.com/wiki/XIAO-RP2040/res/SCHPCB.zip
Youtube video I followed for Arduino coding: https://www.youtube.com/watch?v=3iy2FWI8sWU&t=666s
Im using Arduino IDE ver 2.3.2
And these libraries:
- Keyboard by Arduino 1.0.5
- Simplekeypad by Maxime Bohrer 1.0.0
The code Im using:
#include <SimpleKeypad.h>
#include <Keyboard.h>
const byte nb_ROWS = 4; //four rows
const byte nb_COLS = 6; //four columns
//define the cymbols on the buttons of the keypads
char key_chars [nb_ROWS] [nb_COLS]= {
{ 0, '8', 'A', '9', 'B', 'K'},
{ 0, 'C', 'D', 'E', 'F', 'M'},
{'0', '1', '2', '3', 'G', 'H'},
{'4', '5', '6', '7', 'I', 'J'}
};
byte rowPins[nb_ROWS] ={7, 8, 9, 10} ; //connect to the row pinouts of the keypad
byte colPins[nb_COLS] ={6, 5, 4, 3, 2, 1} ;
SimpleKeypad Mykeypad((char*)key_chars, rowPins, colPins, nb_ROWS, nb_COLS);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println("Press any key on the keypad and it will show up here:");
}
void loop() {
char key = Mykeypad.getKey();
if (key) {
Serial.println(key);
}
if (key =='K') {
Serial.println("K Pulsada");
}
if (key =='B') {
Serial.println("B Pulsada");
}
if (key =='A') {
Serial.println("A Pulsada");
}
if (key =='9') {
Serial.println("9 Pulsada");
}
}
Issue explanation: As I introduced before, only 4 out of 22 keys are responsive. The ones from Column 1 ( S1,S6,S12 and S18 ) but the problem is that when pressed, they show characters from Row 1 of the matrix in the code, this is :
S1-> K S6-> B S12-> A S18-> 9
As you can see, A and 9 are inverted, which blows my mind, honestly.
The rest of the keys do nothing when pressed.
If you have reached to this point reading, thank you.
I read the guidelines to post before I wrote all this and I hope I provided the info and explanations needed so someone can help me. If no, please let me know what else you would need and I will add it.
Im sorry for such long post, Im not capable of explaining it in a shorter manner.

