5x6 button matrix keypad.h

Hi fellow Arduino'ers

Info:

I am building a small (flight) cockpit with 4 pots and 30 buttons (5x6) Matrix

I have the potentimeters of the project sorted and temporarily removed them from my code.

I have connected the matrix as follows:

Pins as follows
Rows: 0,1,2,3,5
Cols: 8,9,10,14,15,16

Problem:

Sometimes when I push a single button it will act as two buttons are being pushed when checking the game controller from my computer. other times two of the same button are giving the same output on the game controller.

Question :

Do I need resistors for the matrix to work? Do I need to have all the buttons connected for the program to work?

Im still pritty new to arduino, any other problems to be rectified will be greatly appreciated

#include "Joystick.h" // include joystick libary
(JOYSTICK_DEFAULT_REPORT_ID,
JOYSTICK_TYPE_JOYSTICK, 30, 0,
false, false, false, false, false, false,
false, false, false, false, false);
#include "Keypad.h" // include keypad libary

#define ENABLE_PULLUPS // Enable Pull-ups for switches
#define Axis 0
#define NUMBUTTONS 30
#define NUMROWS 5 // Rows (down)
#define NUMCOLS 6 // Colums (across)

byte buttons [NUMROWS] [NUMCOLS] = {
{0,1,2,3,4,5},
{6,7,8,9,10,11},
{12,13,14,15,16,17},
{18,19,20,21,22,23},
{24,25,26,27,28,29}
};

byte rowPins [NUMROWS] = {0,1,2,3,5};
byte colPins [NUMCOLS] = {15,14,16,10,9,8};

Keypad buttbx = Keypad( makeKeymap(buttons), rowPins, colPins, NUMROWS, NUMCOLS);

const bool initAutoSendState = true;

void setup() {
// put your setup code here, to run once:
Joystick.begin();

}

void loop() {
// put your main code here, to run repeatedly:

// Keypad loop
char customKey = buttbx.getKey();

}

Please include wiring diagram and code. Please read the how to section of the forum and add the pictures and code as outlined thanks and welcome

Recommend any online schematic editing software with no fee?

Is this okay?

Imgur

OP"s pic - Simple guide for inserting images in a post


It is not a good idea to use pins 0 and 1 (rx/tx) because it will interfere with uploading code unless you disconnect them while uploading.

MonQy_ZN:
Recommend any online schematic editing software with no fee?

Not online, but KiCAD is FOSS.

It's got a serious learning curve, but that's with all CAD software. Nature of the beast.

MonQy_ZN:
Recommend any online schematic editing software with no fee?

Circuitlab.com is vaguely usable.

Hi,
Welcome to the forum.

Please read the post at the start of any forum , entitled "How to use this Forum".
OR
http://forum.arduino.cc/index.php/topic,148850.0.html.
Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Thanks.. Tom.. :slight_smile: