Created
May 15, 2021 10:34
-
-
Save ecehan-civril/b61952a701eb4ea050a4d76fc872a2f5 to your computer and use it in GitHub Desktop.
4x4 keypad kullanımı
This file contains 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> | |
const byte ROWS = 4; //satır | |
const byte COLS = 4; //sutun | |
char buton; | |
char keys [ROWS] [COLS] = { | |
{'1', '2', '3', 'A'}, | |
{'4', '5', '6', 'B'}, | |
{'7', '8', '9', 'C'}, | |
{'*', '0', '#', 'D'} | |
}; | |
byte rowPins[ROWS] = {9, 8, 7, 6}; | |
byte colPins[COLS] = {5, 4, 3, 2}; | |
Keypad myKeypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS ); | |
void setup() | |
{ | |
Serial.begin(9600); //Keypadimizden Gelen Buton Değerlerini Okumak İçin Seri Ekranı Başlatıyoruz | |
} | |
void loop() | |
{ | |
buton = myKeypad.getKey(); //Klavye Adını Verdiğimiz Keypadimizden Gelen Buton Değerlerini Arduinoya Okutuyoruz | |
if (buton) | |
{ | |
Serial.println(buton); //Seri Ekranımıza Basılan Buton Değerini Yazdırıyoruz | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment