Keypad locker system
Locker Prototype 01 Circuit: Simulate Code: #include <Keypad.h> #include <Servo.h> Servo servo1; int servoPin = 11; int pos; int indicator = 12; 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] = {2,3,4,5}; byte colPins[COLS] = {6,7,8,9}; Keypad customKeypad = Keypad(makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS); int pass = 0; void setup(){ servo1.attach(servoPin); servo1.write(0); Serial.begin(9600); Serial.println("Enter the password"); Serial.println("Enter C for clear"); Serial.println("Enter D for Lock"); pinMode(indicator, OUTPUT); digitalWrite(indicator, 0); } void loop(){ char customKey = customKeypad.getKey(); if (customKey){ // Ser
Comments
Post a Comment