ESP8266 Door Access Control System
Loading...
Searching...
No Matches
esp2_keypad.ino File Reference

Keypad-based PIN entry controller with MQTT backend integration. More...

#include <Arduino.h>
#include <Keypad.h>
#include <ArduinoJson.h>
#include <WiFiMqttClient.h>
Include dependency graph for esp2_keypad.ino:

Go to the source code of this file.

Functions

void callback (char *topic, byte *payload, unsigned int length)
 MQTT message callback handler.
void setup ()
 Arduino setup function.
void reset_code ()
 Resets the PIN input buffer and index.
void publishTap ()
 Publishes keypad tap feedback via MQTT.
void loop ()
 Arduino main loop.

Variables

WifiMqttClient net
 WiFi + MQTT client wrapper.
constexpr char WIFI_SSID [] = "Mathias2.4"
 WiFi SSID.
constexpr char WIFI_PASS [] = "mrbombasticcallmefantastic"
 WiFi password.
constexpr char MQTT_HOST [] = "maqiatto.com"
 MQTT broker hostname.
constexpr uint16_t MQTT_PORT = 1883
 MQTT broker port.
constexpr char MQTT_USER [] = "hectorfoss@gmail.com"
 MQTT username.
constexpr char MQTT_PASS [] = "potter"
 MQTT password.
constexpr char DEVICE_ID [] = "door1"
 Unique device identifier used in MQTT topics.
const byte ROWS = 4
 Number of rows in the keypad matrix.
const byte COLS = 4
 Number of columns in the keypad matrix.
char keys [ROWS][COLS]
 Logical keypad layout.
byte rowPins [ROWS] = {16, 5, 4, 0}
 GPIO pins connected to keypad rows.
byte colPins [COLS] = {2, 14, 12, 13}
 GPIO pins connected to keypad columns.
Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS)
 Keypad instance handling scanning and debouncing.
constexpr uint8_t CODE_LENGTH = 4
 Required PIN length.
char input [CODE_LENGTH+1] = {0}
 Input buffer for PIN digits.
uint8_t currentIdx = 0
 Current index into the PIN buffer.
bool kpEnabled = false
 Indicates whether keypad input is currently enabled.

Detailed Description

Keypad-based PIN entry controller with MQTT backend integration.

Definition in file esp2_keypad.ino.