// DEV STANDARD DIMENSION:
const int ROWS = 4;
const int COLS = 14;
int RowsPins[ROWS] = {10, 11, 12, 13};
int ColsPins[COLS] = {23, 25, 27, 29, 31, 33, 35, 37, 39, 41};
String KeyboardKeys[ROWS][COLS] = {
//{"ESC","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"},
//{""\"","1","2","3","4","5","6","7","8","9","0",""'"","ì","BACKSPACE"},
{"TAB", "Q", "W", "E", "R", "T", "Y", "U", "I", "O"},//"P","è","+","ù"},
{"CAPS", "A", "S", "D", "F", "G", "H", "J", "K", "L"},//"ò","à","ENTER",""},
{"L_SHIFT","Z","X","C","V","B","N","M",",","."},//,"-","R_SHIFT","",""},
{"L_CTRL","L_WIN","L_ALT","SPACE","R_ALT","R_WIN","R_CTRL","LEFT","UP","DOWN"}//,"RIGHT","","",""}
};
//
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
}
void loop() {
// put your main code here, to run repeatedly:
ReadKeyboard();
}
void ReadKeyboard(){
// ciclo di alimentazione righe:
for (int r = 0; r <= ROWS - 1; r++){
//pinMode(RowsPins[r],OUTPUT);
digitalWrite(RowsPins[r], HIGH);
// ciclo di lettura colonne:
for (int c = 0; c <= COLS - 1; c++){
if (digitalRead(ColsPins[c]) == HIGH){
Serial.print(KeyboardKeys[r][c]);
}
}
//pinMode(RowsPins[r],INPUT);
digitalWrite(RowsPins[r], LOW);
delayMicroseconds(500);
}
}