1st tests

This commit is contained in:
2022-09-15 22:34:54 +02:00
commit 47914a7650
7 changed files with 810 additions and 0 deletions

28
keypad/keypad/keypad.ino Normal file
View File

@@ -0,0 +1,28 @@
#include <Key.h>
#include <Keypad.h>
const byte rows = 4; //four rows
const byte cols = 3; //three columns
char keys[rows][cols] = {
{'1','5','9'},
{'2','6','x'},
{'3','7','y'},
{'4','8','z'}
};
byte rowPins[rows] = {1, 2, 3, 0}; //connect to the row pinouts of the keypad
byte colPins[cols] = {21, 22, 23}; //connect to the column pinouts of the keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, rows, cols );
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
char customKey = keypad.getKey();
if (customKey){
Serial.println(customKey);
}
}