const byte ROWS = 4; // Four rows
const byte COLS = 3; // Three columns
// Define the Keymap
char keys[ROWS][COLS] = {
{'1','2','3'},
{'4','5','6'},
{'7','8','9'},
{'#','0','*'}
};
// Connect keypad ROW0, ROW1, ROW2 and ROW3 to these Arduino pins.
byte rowPins[ROWS] = { 9, 8, 7, 6 };
// Connect keypad COL0, COL1 and COL2 to these Arduino pins.
byte colPins[COLS] = { 12, 11, 10 };
the numbers in {9,8,7,6} are the pins in the arduino if im correct.
but what about the numbers that i found out were connected how do i implement that into my program or how can i connect them to those seven pins?
im trying to write a program where i type in a code and light up an LED but just need more clarification with the keypad and how it works
The keypad that you bought is not a 'matrix keypad'. Your keypad has a common pin for one side of all of the keys and a separate pin for the other side of each key. In other words there is a separate discrete pin that identifies each key. This makes the programming a lot easier at the expense of using more I/O pins. You can look into solutions that use the analog inputs to read the keypad, but the matrix keypad library won't work.
floresta:
The keypad that you bought is not a 'matrix keypad'. Your keypad has a common pin for one side of all of the keys and a separate pin for the other side of each key. In other words there is a separate discrete pin that identifies each key. This makes the programming a lot easier at the expense of using more I/O pins. You can look into solutions that use the analog inputs to read the keypad, but the matrix keypad library won't work.
Don
oh i thought i could since in this website where they sell the product http://www.electronics123.com/s.nl/it.A/id.2205/.f
they have a link to the arduino tutorial. and the keypad used in the tutorial has a 14 pin output but they still program it using seven pins
they have a link to the arduino tutorial. and the keypad used in the tutorial has a 14 pin output but they still program it using seven pins
The link is inappropriate for the keypad they are selling. The keypad used in the tutorial has 14 pins but only 7 of them are being used. Your keypad has 14 pins and only 13 of them are being used. The keypads look the same but you still can't use code for a 'matrix keypad' on a keypad with a 'common output'.