Here's a few line coding on my first attempt
#include <LiquidCrystal_I2C.h> #include <Keypad.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
constexpr uint8_t greenLed = 7; constexpr uint8_t redLed = 6;
char initial_password[4] = {'1', '2', '3', '4'};
char key_pressed = 0;
const byte rows = 4; const byte columns = 4;
char hexaKeys[rows][columns] = {
{'1', '2', '3', 'A'},
{'4', '5', '6', 'B'},
{'7', '8', '9', 'C'},
{'*', '0', '#', 'D'}
};
// Initializing pins for keypad
byte row_pins[rows] = {A0, A1, A2, A3};
byte column_pins[columns] = {2, 1, 0};
// Create instance for keypad
Keypad keypad_key = Keypad( makeKeymap(hexaKeys), row_pins, column_pins, rows, columns);
void setup() {
// Arduino Pin configuration
pinMode(buzzerPin, OUTPUT);
pinMode(redLed, OUTPUT);
pinMode(greenLed, OUTPUT);
lcd.begin(); // LCD screen
lcd.backlight(); SPI.begin();
Next, I need to do research about the MFRC522 and GSM900 module to complete my project.
No comments:
Post a Comment