I have already programmed the Leonardo with a matrix keyboard, and I need help on how I can modify the code to make the keyboard using 74HC165?
For example the part of the code now is
#include <Keypad.h>
#include <Keyboard.h>
const byte ROWS = 6; //four rows
const byte COLS = 6; //three columns
char keys[ROWS][COLS] = {
{'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','30'},
{'31','32','33','34','35','36'}
};
byte rowPins[ROWS] = {7, 6, 5, 4, 3, 2,}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {13, 12, 11, 10, 9, 8,}; //connect to the column pinouts of the keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
void setup(){
Serial.begin(9600);
Keyboard.begin();
}
void loop()
{
char key = keypad.getKey();
switch (key)
{
case '1': ///MASTER_OFF
Keyboard.press(KEY_LEFT_CTRL);
Keyboard.press(KEY_LEFT_ALT);
Keyboard.press(KEY_F9);
delay(100);
Keyboard.releaseAll();
break;
case '2': ///MASTER STRY
Keyboard.press(KEY_LEFT_CTRL);
Keyboard.press(KEY_LEFT_SHIFT);
Keyboard.press(KEY_LEFT_ALT);
Keyboard.press(KEY_F9);
delay(100);
Keyboard.releaseAll();
break;
case '3': ///MASTER LOW
Keyboard.press(KEY_LEFT_CTRL);
Keyboard.press(KEY_LEFT_SHIFT);
Keyboard.press(KEY_F10);
delay(100);
Keyboard.releaseAll();
break;