Hi:
I'm working on a matrix switch (4x3) made with some blue switches I had lying around. I'm using the Arduino pro micro
Here's a picture of the wiring, I'm using 1N4148 diodes for the rows connections, the green circles indicate to which Arduino pins every row/col are connected.
And here's my code:
#include <Keypad.h>
const byte ROWS = 4;
const byte COLS = 3;
char keys[ROWS][COLS] =
{
{'1', '2', '3',},
{'4', '5', '6',},
{'7', '8', '9',},
{'A', 'B', 'C'}
};
byte colPins[COLS] = {7,8,9}; //column pins
byte rowPins[ROWS] = {2, 3, 4, 5}; //row pins
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
void setup()
{
Serial.begin(115200);
delay(1500);
Serial.println("init ok ...");
}
void loop()
{
char key = keypad.getKey();
if (key)
{
Serial.print("key : ");
Serial.println(key);
}
}
Code compiles/uploads ok, but nothing happens when I press a key.
Here's what I've tried:
1- Adding these lines to the setup() routine:
pinMode(7, INPUT_PULLUP);
pinMode(8, INPUT_PULLUP);
pinMode(9, INPUT_PULLUP);
Same result: nothing happens when switch is pressed.
2- Continuity tested columns wiring, each individual switch and they work. Rows wiring also pass continuity test when pressed.
3- Measure if any voltage was detected in the row connection (start and end point) when a switch is pressed: my multi-meter goes from 0 to around 0.11~0.13 V. I don't know if this is ok.
My guess is I need to connect some ground or maybe even set columns to HIGH? but I want to avoid magic smoke so I thought asking here first. Any help will be much appreciated.

