Skip to content

Instantly share code, notes, and snippets.

@ecehan-civril
Created May 15, 2021 10:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ecehan-civril/b61952a701eb4ea050a4d76fc872a2f5 to your computer and use it in GitHub Desktop.
Save ecehan-civril/b61952a701eb4ea050a4d76fc872a2f5 to your computer and use it in GitHub Desktop.
4x4 keypad kullanımı
#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