Untitled
unknown
plain_text
2 years ago
927 B
4
Indexable
#include <Arduino.h> #include <Keypad.h> char kodFunkcni[] = {7,3,5,5,6,0,8,'*'}; char kodZadavaci[] = {'|','|','|','|','|','|','|'}; int pocitadlo = 0; const byte ROWS = 4; const byte COLS = 4; char hexaKeys[ROWS][COLS] = { {'1', '2', '3', 'A'}, {'4', '5', '6', 'B'}, {'7', '8', '9', 'C'}, {'*', '0', '#', 'D'} }; byte rowPins[ROWS] = {13, 12 , 14, 27}; byte colPins[COLS] = {26, 25, 19, 18}; Keypad customKeypad = Keypad(makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS); void setup(){ Serial.begin(9600); } void loop(){ char customKey = customKeypad.getKey(); if(customKey== '#') { char kodZadavaci[] = {'|','|','|','|','|','|','|'}; } else { kodFunkcni[pocitadlo] = customKey; pocitadlo++; } if (kodFunkcni==kodZadavaci) { Serial.println("KABOOM"); } if (customKey){ Serial.println(customKey); } }
Editor is loading...