Last active
November 11, 2021 20:17
-
-
Save sunify/b2719a9f6fdc42cfc157804e5b209648 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Keypad.h> | |
#include <Keyboard.h> | |
const byte ROWS = 3; | |
const byte COLS = 3; | |
char hexaKeys[ROWS][COLS] = { | |
{'7','8','9'}, | |
{'4','5','6'}, | |
{'1','2','3'} | |
}; | |
byte rowPins[ROWS] = {10, 16, 14}; | |
byte colPins[COLS] = {9, 8, 7}; | |
// Если замыкаются пины 10 и 9, печатаем 7. Если замыкаются 14 и 7 — 3 и т.д. | |
Keypad customKeypad = Keypad(makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS); | |
void setup(){ | |
Serial.begin(9600); | |
Keyboard.begin(); | |
} | |
void loop(){ | |
char customKey = customKeypad.getKey(); | |
Keyboard.write(customKey); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment