Components and supplies
Generic push button
1 Channel Relay
4x4 Keypad Matrix
LCD i²c
Arduino UNO
Linear solenoid lock
IRF510N MOSFET
Tools and machines
Breadboard, 170 Pin
10 Pc. Jumper Wire Kit, 5 cm Long
Project description
Code
Keypad_doorlock_solenoid.ino
arduino
Remember to upload the code first then uncomment line 62 to 64 and reupload, it's done only once.
Keypad_doorlock_relay.ino
arduino
Remember to upload the code first then uncomment line 62 to 64 and reupload, it's done only once.
Keypad_doorlock_solenoid.ino
arduino
Remember to upload the code first then uncomment line 62 to 64 and reupload, it's done only once.
Keypad_doorlock_relay.ino
arduino
Remember to upload the code first then uncomment line 62 to 64 and reupload, it's done only once.
Downloadable files
Relay wiring
Relay wiring
Relay wiring
Relay wiring
Mosfet + Solenoid wiring
Mosfet + Solenoid wiring
Comments
Only logged in users can leave comments
mane_er
8 months ago
In addition to that, you can delete the rest of the LCD´s libraries bc as far as i know they block the Newliquidcrystal from working for some reason
Jeff383
a year ago
// This works good with my <LiquidCrystal_I2C.h> Thanks nice work! /* This code works with 4x4 Keypad Matrix, LCD ic, relay module and a push button * It's a lock where the relay can control a lock you can open with correct code * The code can be changed directly by the keypad and doesn't require uploading code again * Code is stored in EEPROM * Refer to www.surtrtech.com for more details */ #include <Keypad.h> #include <EEPROM.h> #include <LiquidCrystal_I2C.h> #define Relay 11 //Controls the Relay const byte numRows= 4; //number of rows on the keypad const byte numCols= 4; //number of columns on the keypad char keymap[numRows][numCols]= { {'1', '2', '3', 'A'}, {'4', '5', '6', 'B'}, {'7', '8', '9', 'C'}, {'*', '0', '#', 'D'} }; char keypressed; //Where the keys are stored it changes very often char code[]= {'6','6','0','1'}; //The default code, you can change it or make it a 'n' digits one char code_buff1[sizeof(code)]; //Where the new key is stored char code_buff2[sizeof(code)]; //Where the new key is stored again so it's compared to the previous one short a=0,i=0,s=0,j=0; //Variables used later byte rowPins[numRows] = {9,8,7,6}; //Rows 0 to 3 //if you modify your pins you should modify this too byte colPins[numCols]= {5,4,3,2}; //Columns 0 to 3 LiquidCrystal_I2C lcd(0x3F,16,2); Keypad myKeypad= Keypad(makeKeymap(keymap), rowPins, colPins, numRows, numCols); void setup() { lcd.init (); lcd.setBacklight(HIGH); //Lighting backlight lcd.home (); lcd.print("Standby"); //What's written on the LCD you can change pinMode(Relay,OUTPUT); for(i=0 ; i<sizeof(code);i++){ //When you upload the code the first time keep it commented EEPROM.get(i, code[i]); //Upload the code and change it to store it in the EEPROM } //Then uncomment this for loop and reupload the code (It's done only once) } void loop() { keypressed = myKeypad.getKey(); //Constantly waiting for a key to be pressed if(keypressed == '*'){ // * to open the lock lcd.clear(); lcd.setCursor(0,0); lcd.print("Enter code"); //Message to show GetCode(); //Getting code function if(a==sizeof(code)) //The GetCode function assign a value to a (it's correct when it has the size of the code array) OpenDoor(); //Open lock function if code is correct else{ lcd.clear(); lcd.print("Wrong"); //Message to print when the code is wrong } delay(2000); lcd.clear(); lcd.print("Standby"); //Return to standby mode it's the message do display when waiting } if(keypressed == '#'){ //To change the code it calls the changecode function ChangeCode(); lcd.clear(); lcd.print("Standby"); //When done it returns to standby mode } } void GetCode(){ //Getting code sequence i=0; //All variables set to 0 a=0; j=0; while(keypressed != 'A'){ //The user press A to confirm the code otherwise he can keep typing keypressed = myKeypad.getKey(); if(keypressed != NO_KEY && keypressed != 'A' ){ //If the char typed isn't A and neither "nothing" lcd.setCursor(j,1); //This to write "*" on the LCD whenever a key is pressed it's position is controlled by j lcd.print("*"); j++; if(keypressed == code[i]&& i<sizeof(code)){ //if the char typed is correct a and i increments to verify the next caracter a++; //Now I think maybe I should have use only a or i ... too lazy to test it -_-' i++; } else a--; //if the character typed is wrong a decrements and cannot equal the size of code [] } } keypressed = NO_KEY; } void ChangeCode(){ //Change code sequence lcd.clear(); lcd.print("Changing code"); delay(1000); lcd.clear(); lcd.print("Enter old code"); GetCode(); //verify the old code first so you can change it if(a==sizeof(code)){ //again verifying the a value lcd.clear(); lcd.print("Changing code"); GetNewCode1(); //Get the new code GetNewCode2(); //Get the new code again to confirm it s=0; for(i=0 ; i<sizeof(code) ; i++){ //Compare codes in array 1 and array 2 from two previous functions if(code_buff1[i]==code_buff2[i]) s++; //again this how we verifiy, increment s whenever codes are matching } if(s==sizeof(code)){ //Correct is always the size of the array for(i=0 ; i<sizeof(code) ; i++){ code[i]=code_buff2[i]; //the code array now receives the new code EEPROM.put(i, code[i]); //And stores it in the EEPROM } lcd.clear(); lcd.print("Code Changed"); delay(2000); } else{ //In case the new codes aren't matching lcd.clear(); lcd.print("Codes are not"); lcd.setCursor(0,1); lcd.print("matching !!"); delay(2000); } } else{ //In case the old code is wrong you can't change it lcd.clear(); lcd.print("Wrong"); delay(2000); } } void GetNewCode1(){ i=0; j=0; lcd.clear(); lcd.print("Enter new code"); //tell the user to enter the new code and press A lcd.setCursor(0,1); lcd.print("and press A"); delay(2000); lcd.clear(); lcd.setCursor(0,1); lcd.print("and press A"); //Press A keep showing while the top row print *** while(keypressed != 'A'){ //A to confirm and quits the loop keypressed = myKeypad.getKey(); if(keypressed != NO_KEY && keypressed != 'A' ){ lcd.setCursor(j,0); lcd.print("*"); //On the new code you can show * as I did or change it to keypressed to show the keys code_buff1[i]=keypressed; //Store caracters in the array i++; j++; } } keypressed = NO_KEY; } void GetNewCode2(){ //This is exactly like the GetNewCode1 function but this time the code is stored in another array i=0; j=0; lcd.clear(); lcd.print("Confirm code"); lcd.setCursor(0,1); lcd.print("and press A"); delay(3000); lcd.clear(); lcd.setCursor(0,1); lcd.print("and press A"); while(keypressed != 'A'){ keypressed = myKeypad.getKey(); if(keypressed != NO_KEY && keypressed != 'A' ){ lcd.setCursor(j,0); lcd.print("*"); code_buff2[i]=keypressed; i++; j++; } } keypressed = NO_KEY; } void OpenDoor(){ //Lock opening function open for 5s lcd.clear(); lcd.print("Welcome"); //With a message printed digitalWrite(Relay,HIGH); delay(5000); digitalWrite(Relay,LOW); }
mrmta
a year ago
Hi dear, tnx for your this project. Can you help me and add to this project to multiple password for different user? I very need to this please 🙏🏻
gstonedo
a year ago
There seems to be a problem with the "Keypad_doorlock_solenoid.ino" code. When uploading the code an error occurs; no matching function for call to 'LiquidCrystal_I2C::LiquidCrystal_I2C(int, int, int, int, int, int, int, int)' The error is on line 48. (there may be more but i don't know yet)
Anonymous user
2 years ago
I am having lots of errors while compiling the code
Anonymous user
2 years ago
Hello all. I am trying to submit a version of the project with relay wiring. I connected everything according to the schematic, but when I try to compile the project I have a lot of errors, it seems to me that the content of the LiquidCrystal_I2C library has changed and therefore refuses to compile: / Did anyone handle this problem? I am pasting the compile error log below(I'm from Poland, so some part of code is in polish, but it shouldn't be a problem:) ): Arduino:1.8.13 (Windows Store 1.8.42.0) (Windows 10), Płytka:"Arduino Uno" C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\arduino-builder -dump-prefs -logger=machine -hardware C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware -tools C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\ ools-builder -tools C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\ ools\\avr -built-in-libraries C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\libraries -libraries C:\\Users\\lukas\\Documents\\Arduino\\libraries -fqbn=arduino:avr:uno -ide-version=10813 -build-path C:\\Users\\lukas\\AppData\\Local\\Temp\\arduino_build_833409 -warnings=none -build-cache C:\\Users\\lukas\\AppData\\Local\\Temp\\arduino_cache_783851 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\ ools\\avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\ ools\\avr -prefs=runtime.tools.avrdude.path=C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\ ools\\avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\ ools\\avr -prefs=runtime.tools.avr-gcc.path=C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\ ools\\avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\ ools\\avr -verbose C:\\Users\\lukas\\Documents\\Arduino\\prototyp1\\prototyp1.ino C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\arduino-builder -compile -logger=machine -hardware C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware -tools C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\ ools-builder -tools C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\ ools\\avr -built-in-libraries C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\libraries -libraries C:\\Users\\lukas\\Documents\\Arduino\\libraries -fqbn=arduino:avr:uno -ide-version=10813 -build-path C:\\Users\\lukas\\AppData\\Local\\Temp\\arduino_build_833409 -warnings=none -build-cache C:\\Users\\lukas\\AppData\\Local\\Temp\\arduino_cache_783851 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\ ools\\avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\ ools\\avr -prefs=runtime.tools.avrdude.path=C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\ ools\\avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\ ools\\avr -prefs=runtime.tools.avr-gcc.path=C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\ ools\\avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\ ools\\avr -verbose C:\\Users\\lukas\\Documents\\Arduino\\prototyp1\\prototyp1.ino Using board 'uno' from platform in folder: C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\\arduino\\avr Using core 'arduino' from platform in folder: C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\\arduino\\avr Detecting libraries used... "C:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\ ools\\\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\cores\\\\arduino" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\variants\\\\standard" "C:\\\\Users\\\\lukas\\\\AppData\\\\Local\\\\Temp\\\\arduino_build_833409\\\\sketch\\\\prototyp1.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE Alternatives for Keypad.h: [Keypad-master@3.1.1 Keypad@3.1.0] ResolveLibrary(Keypad.h) -> candidates: [Keypad-master@3.1.1 Keypad@3.1.0] "C:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\ ools\\\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\cores\\\\arduino" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\variants\\\\standard" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\Keypad\\\\src" "C:\\\\Users\\\\lukas\\\\AppData\\\\Local\\\\Temp\\\\arduino_build_833409\\\\sketch\\\\prototyp1.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE Alternatives for EEPROM.h: [EEPROM@2.0] ResolveLibrary(EEPROM.h) -> candidates: [EEPROM@2.0] "C:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\ ools\\\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\cores\\\\arduino" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\variants\\\\standard" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\Keypad\\\\src" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\EEPROM\\\\src" "C:\\\\Users\\\\lukas\\\\AppData\\\\Local\\\\Temp\\\\arduino_build_833409\\\\sketch\\\\prototyp1.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE Alternatives for LiquidCrystal_I2C.h: [NewLiquidCrystal-master LiquidCrystal_I2C-1.1.2@1.1.2] ResolveLibrary(LiquidCrystal_I2C.h) -> candidates: [NewLiquidCrystal-master LiquidCrystal_I2C-1.1.2@1.1.2] "C:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\ ools\\\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\cores\\\\arduino" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\variants\\\\standard" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\Keypad\\\\src" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\EEPROM\\\\src" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\LiquidCrystal_I2C-1.1.2" "C:\\\\Users\\\\lukas\\\\AppData\\\\Local\\\\Temp\\\\arduino_build_833409\\\\sketch\\\\prototyp1.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE Alternatives for Wire.h: [Wire@1.0] ResolveLibrary(Wire.h) -> candidates: [Wire@1.0] "C:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\ ools\\\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\cores\\\\arduino" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\variants\\\\standard" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\Keypad\\\\src" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\EEPROM\\\\src" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\LiquidCrystal_I2C-1.1.2" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\Wire\\\\src" "C:\\\\Users\\\\lukas\\\\AppData\\\\Local\\\\Temp\\\\arduino_build_833409\\\\sketch\\\\prototyp1.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE "C:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\ ools\\\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\cores\\\\arduino" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\variants\\\\standard" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\Keypad\\\\src" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\EEPROM\\\\src" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\LiquidCrystal_I2C-1.1.2" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\Wire\\\\src" "C:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\Keypad\\\\src\\\\Key.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE "C:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\ ools\\\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\cores\\\\arduino" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\variants\\\\standard" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\Keypad\\\\src" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\EEPROM\\\\src" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\LiquidCrystal_I2C-1.1.2" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\Wire\\\\src" "C:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\Keypad\\\\src\\\\Keypad.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE "C:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\ ools\\\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\cores\\\\arduino" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\variants\\\\standard" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\Keypad\\\\src" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\EEPROM\\\\src" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\LiquidCrystal_I2C-1.1.2" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\Wire\\\\src" "C:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\LiquidCrystal_I2C-1.1.2\\\\LiquidCrystal_I2C.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE "C:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\ ools\\\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\cores\\\\arduino" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\variants\\\\standard" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\Keypad\\\\src" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\EEPROM\\\\src" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\LiquidCrystal_I2C-1.1.2" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\Wire\\\\src" "C:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\Wire\\\\src\\\\Wire.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE "C:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\ ools\\\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\cores\\\\arduino" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\variants\\\\standard" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\Keypad\\\\src" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\EEPROM\\\\src" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\LiquidCrystal_I2C-1.1.2" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\Wire\\\\src" "C:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\Wire\\\\src\\\\utility\\\ wi.c" -o nul -DARDUINO_LIB_DISCOVERY_PHASE Generating function prototypes... "C:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\ ools\\\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\cores\\\\arduino" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\variants\\\\standard" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\Keypad\\\\src" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\EEPROM\\\\src" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\LiquidCrystal_I2C-1.1.2" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\Wire\\\\src" "C:\\\\Users\\\\lukas\\\\AppData\\\\Local\\\\Temp\\\\arduino_build_833409\\\\sketch\\\\prototyp1.ino.cpp" -o "C:\\\\Users\\\\lukas\\\\AppData\\\\Local\\\\Temp\\\\arduino_build_833409\\\\preproc\\\\ctags_target_for_gcc_minus_e.cpp" -DARDUINO_LIB_DISCOVERY_PHASE "C:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\ ools-builder\\\\ctags\\\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\\\Users\\\\lukas\\\\AppData\\\\Local\\\\Temp\\\\arduino_build_833409\\\\preproc\\\\ctags_target_for_gcc_minus_e.cpp" Kompilowanie szkicu... "C:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\ ools\\\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\cores\\\\arduino" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\variants\\\\standard" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\Keypad\\\\src" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\EEPROM\\\\src" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\LiquidCrystal_I2C-1.1.2" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\Wire\\\\src" "C:\\\\Users\\\\lukas\\\\AppData\\\\Local\\\\Temp\\\\arduino_build_833409\\\\sketch\\\\prototyp1.ino.cpp" -o "C:\\\\Users\\\\lukas\\\\AppData\\\\Local\\\\Temp\\\\arduino_build_833409\\\\sketch\\\\prototyp1.ino.cpp.o" prototyp1:40:80: error: no matching function for call to 'LiquidCrystal_I2C::LiquidCrystal_I2C(int, int, int, int, int, int, int, int)' LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin); ^ In file included from C:\\Users\\lukas\\Documents\\Arduino\\prototyp1\\prototyp1.ino:3:0: C:\\Users\\lukas\\Documents\\Arduino\\libraries\\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:57:3: note: candidate: LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t, uint8_t, uint8_t) LiquidCrystal_I2C(uint8_t lcd_Addr,uint8_t lcd_cols,uint8_t lcd_rows); ^~~~~~~~~~~~~~~~~ C:\\Users\\lukas\\Documents\\Arduino\\libraries\\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:57:3: note: candidate expects 3 arguments, 8 provided C:\\Users\\lukas\\Documents\\Arduino\\libraries\\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:55:7: note: candidate: constexpr LiquidCrystal_I2C::LiquidCrystal_I2C(const LiquidCrystal_I2C&) class LiquidCrystal_I2C : public Print { ^~~~~~~~~~~~~~~~~ C:\\Users\\lukas\\Documents\\Arduino\\libraries\\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:55:7: note: candidate expects 1 argument, 8 provided C:\\Users\\lukas\\Documents\\Arduino\\libraries\\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:55:7: note: candidate: constexpr LiquidCrystal_I2C::LiquidCrystal_I2C(LiquidCrystal_I2C&&) C:\\Users\\lukas\\Documents\\Arduino\\libraries\\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:55:7: note: candidate expects 1 argument, 8 provided C:\\Users\\lukas\\Documents\\Arduino\\prototyp1\\prototyp1.ino: In function 'void setup()': prototyp1:46:15: error: 'class LiquidCrystal_I2C' has no member named 'setBacklightPin'; did you mean 'setBacklight'? lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE); ^~~~~~~~~~~~~~~ setBacklight prototyp1:46:45: error: 'POSITIVE' was not declared in this scope lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE); ^~~~~~~~ Znaleziono wiele bibliotek w "LiquidCrystal_I2C.h" Wykorzystane: C:\\Users\\lukas\\Documents\\Arduino\\libraries\\LiquidCrystal_I2C-1.1.2 Niewykorzystane: C:\\Users\\lukas\\Documents\\Arduino\\libraries\\NewLiquidCrystal-master Znaleziono wiele bibliotek w "Keypad.h" Wykorzystane: C:\\Users\\lukas\\Documents\\Arduino\\libraries\\Keypad Niewykorzystane: C:\\Users\\lukas\\Documents\\Arduino\\libraries\\Keypad-master Użycie biblioteki Keypad w wersji 3.1.0 z folderu: C:\\Users\\lukas\\Documents\\Arduino\\libraries\\Keypad Użycie biblioteki EEPROM w wersji 2.0 z folderu: C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\\arduino\\avr\\libraries\\EEPROM Użycie biblioteki LiquidCrystal_I2C-1.1.2 w wersji 1.1.2 z folderu: C:\\Users\\lukas\\Documents\\Arduino\\libraries\\LiquidCrystal_I2C-1.1.2 Użycie biblioteki Wire w wersji 1.0 z folderu: C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\\arduino\\avr\\libraries\\Wire exit status 1 no matching function for call to 'LiquidCrystal_I2C::LiquidCrystal_I2C(int, int, int, int, int, int, int, int)'
Anonymous user
2 years ago
I have a problem in entering default code can anyone help?
NoaLef
2 years ago
Does not work
Anonymous user
2 years ago
Heya, I just found this awesome project! Now I am scratching parts together and starting to set up. Question comes to mind, is it possible to make it work with a magnetic lock? Photo 2 The wiring are lookin OK to my mind. Magnetic lock is connected to relay and yeye?! I have found a lock but the seller is not highly rated, so if some one could help me to tell some place in Europe, where is it possible to buy that type of magnetic lock??? I got these parts: - UNO R3 - LCD i²c - 4x4 keypad matrix - one channel relay - normal switch Boxes I have to buy also to make it look like a "pro" :) This project is for my daughter and her room door locking... Parents are not welcome at teens home, hehehe! So familiar... So is there anything I should know before starting action?? All help and advice is welcome and high hat for person who do so!!! Music link to you all DIY Peoples :) https://www.youtube.com/watch?v=r_DebdQ2DLM&t=501s Kindly, robingood Finland
Anonymous user
2 years ago
There a part of the code where you say "Remember to upload the code first then uncomment line 62 to 64 and reupload, it's done only once." I think you meant "63 to 65" I am having problems with: "/tmp/136399509/keypad_4x4_and_lcd/keypad_4x4_and_lcd.ino:51:80: error: no matching function for call to 'LiquidCrystal_I2C::LiquidCrystal_I2C(int, int, int, int, int, int, int, int)' LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin); ^" my guess is that the library changed?.. there are multiple libraries with that name could you direct us to the one you use? Thanks
iplaysax226
2 years ago
how would i adapt this to use a servo or stepper to open the lock/door?
Anonymous user
2 years ago
Hi, can you help me with my project?
Anonymous user
2 years ago
Arduino: 1.8.19 (Windows Store 1.8.57.0) (Windows 10), Board: "Arduino Uno" Keypad_doorlock_relay:48:80: error: no matching function for call to 'LiquidCrystal_I2C::LiquidCrystal_I2C(int, int, int, int, int, int, int, int)' LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin); ^ In file included from C:\\Users\\usama\\Downloads\\Keypad_doorlock_relay\\Keypad_doorlock_relay.ino:11:0: C:\\Users\\usama\\OneDrive\\Documents\\Arduino\\libraries\\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:57:3: note: candidate: LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t, uint8_t, uint8_t) LiquidCrystal_I2C(uint8_t lcd_Addr,uint8_t lcd_cols,uint8_t lcd_rows); ^~~~~~~~~~~~~~~~~ C:\\Users\\usama\\OneDrive\\Documents\\Arduino\\libraries\\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:57:3: note: candidate expects 3 arguments, 8 provided C:\\Users\\usama\\OneDrive\\Documents\\Arduino\\libraries\\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:55:7: note: candidate: constexpr LiquidCrystal_I2C::LiquidCrystal_I2C(const LiquidCrystal_I2C&) class LiquidCrystal_I2C : public Print { ^~~~~~~~~~~~~~~~~ C:\\Users\\usama\\OneDrive\\Documents\\Arduino\\libraries\\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:55:7: note: candidate expects 1 argument, 8 provided C:\\Users\\usama\\OneDrive\\Documents\\Arduino\\libraries\\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:55:7: note: candidate: constexpr LiquidCrystal_I2C::LiquidCrystal_I2C(LiquidCrystal_I2C&&) C:\\Users\\usama\\OneDrive\\Documents\\Arduino\\libraries\\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:55:7: note: candidate expects 1 argument, 8 provided C:\\Users\\usama\\Downloads\\Keypad_doorlock_relay\\Keypad_doorlock_relay.ino: In function 'void setup()': Keypad_doorlock_relay:54:15: error: 'class LiquidCrystal_I2C' has no member named 'setBacklightPin'; did you mean 'setBacklight'? lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE); ^~~~~~~~~~~~~~~ setBacklight Keypad_doorlock_relay:54:45: error: 'POSITIVE' was not declared in this scope lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE); ^~~~~~~~ exit status 1 no matching function for call to 'LiquidCrystal_I2C::LiquidCrystal_I2C(int, int, int, int, int, int, int, int)' This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.
Anonymous user
2 years ago
thanks for taking the time to comment on nearly every line of code... as a beginner it was really helpful to me, made it super easy to tweak the code for my hardware.
Anonymous user
2 years ago
Super project!
Anonymous user
2 years ago
how to add commands so that we can delete characters such as pressing the back space before pressing the "A" button the following command doesn't work keypressed = myKeypad.getKey(); //Constantly waiting for a key to be pressed if(keypressed == '*'){ // * to open the lock lcd.clear(); lcd.setCursor(0,0); lcd.print("Enter code"); //Message to show GetCode(); //Getting code function if(a==sizeof(code)) //The GetCode function assign a value to a (it's correct when it has the size of the code array) OpenDoor(); //Open lock function if code is correct //I add here =========================== if(keypressed == 'C'){ //Clear Code lcd.clear(); //lcd.print("Standby"); //When done it returns to standby mode } //end==== else{ lcd.clear(); lcd.print("Wrong"); //Message to print when the code is wrong } delay(2000); lcd.clear(); lcd.print("Standby"); //Return to standby mode it's the message do display when waiting }
Anonymous user
2 years ago
Thanks A lottttt for saving my time....Really i was searching for this code...very clearly Explained with comment on each line ...very very useful ...
Anonymous user
2 years ago
please i have a problem with the sketch, the <Keypad.h> was not found so i change it to <Adafruit_Keypad.h> and have this error 'class Adafruit_Keypad' has no member named 'getKey' please someone shound help me out
Anonymous user
2 years ago
// here is the updated code, you need to download libraries : NewLiquidCrystal_1.5.1 and Keypad-master ``/* This code works with 4x4 Keypad Matrix, LCD ic, IRF510N transistor and a push button * It's a lock where the transistor drives a solenoid lock you can open either with correct code * or by the push button from inside * The code can be changed directly by the keypad and doesn't require uploading code again * Code is stored in EEPROM * Refer to www.surtrtech.com for more details */ #include <Keypad.h> #include <EEPROM.h> #include <LiquidCrystal_I2C.h> #define Solenoid 11 //Actually the Gate of the transistor that controls the solenoid #define O_Button 10 //Push Button #define I2C_ADDR 0x27 //I2C adress, you should use the code to scan the adress first (0x27) here #define BACKLIGHT_PIN 3 // Declaring LCD Pins #define En_pin 2 #define Rw_pin 1 #define Rs_pin 0 #define D4_pin 4 #define D5_pin 5 #define D6_pin 6 #define D7_pin 7 const byte numRows= 4; //number of rows on the keypad const byte numCols= 4; //number of columns on the keypad char keymap[numRows][numCols]= { {'1', '2', '3', 'A'}, {'4', '5', '6', 'B'}, {'7', '8', '9', 'C'}, {'*', '0', '#', 'D'} }; char keypressed; //Where the keys are stored it changes very often char code[]= {'6','6','0','1'}; //The default code, you can change it or make it a 'n' digits one char code_buff1[sizeof(code)]; //Where the new key is stored char code_buff2[sizeof(code)]; //Where the new key is stored again so it's compared to the previous one short a=0,i=0,s=0,j=0; //Variables used later byte rowPins[numRows] = {9,8,7,6}; //Rows 0 to 3 //if you modify your pins you should modify this too byte colPins[numCols]= {5,4,3,2}; //Columns 0 to 3 LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin); Keypad myKeypad= Keypad(makeKeymap(keymap), rowPins, colPins, numRows, numCols); void setup() { lcd.begin (16,2); // lcd.setBacklight(BACKLIGHT_PIN,POSITIVE); lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE); lcd.setBacklight(HIGH); //Lighting backlight lcd.home (); lcd.print("Standby"); //What's written on the LCD you can change pinMode(Solenoid,OUTPUT); pinMode(O_Button,INPUT); // for(i=0 ; i<sizeof(code);i++){ //When you upload the code the first time keep it commented // EEPROM.get(i, code[i]); //Upload the code and change it to store it in the EEPROM // } //Then uncomment this for loop and reupload the code (It's done only once) } void loop() { keypressed = myKeypad.getKey(); //Constantly waiting for a key to be pressed if(keypressed == '*'){ // * to open the lock lcd.clear(); lcd.setCursor(0,0); lcd.print("Enter code"); //Message to show GetCode(); //Getting code function if(a==sizeof(code)) //The GetCode function assign a value to a (it's correct when it has the size of the code array) OpenDoor(); //Open lock function if code is correct else{ lcd.clear(); lcd.print("Wrong"); //Message to print when the code is wrong } delay(2000); lcd.clear(); lcd.print("Standby"); //Return to standby mode it's the message do display when waiting } if(keypressed == '#'){ //To change the code it calls the changecode function ChangeCode(); lcd.clear(); lcd.print("Standby"); //When done it returns to standby mode } if(digitalRead(O_Button)==HIGH){ //Opening by the push button digitalWrite(Solenoid,HIGH); delay(3000); //Opens for 3s you can change digitalWrite(Solenoid,LOW); } } void GetCode(){ //Getting code sequence i=0; //All variables set to 0 a=0; j=0; while(keypressed != 'A'){ //The user press A to confirm the code otherwise he can keep typing keypressed = myKeypad.getKey(); if(keypressed != NO_KEY && keypressed != 'A' ){ //If the char typed isn't A and neither "nothing" lcd.setCursor(j,1); //This to write "*" on the LCD whenever a key is pressed it's position is controlled by j lcd.print("*"); j++; if(keypressed == code[i]&& i<sizeof(code)){ //if the char typed is correct a and i increments to verify the next caracter a++; //Now I think maybe I should have use only a or i ... too lazy to test it -_-' i++; } else a--; //if the character typed is wrong a decrements and cannot equal the size of code [] } } keypressed = NO_KEY; } void ChangeCode(){ //Change code sequence lcd.clear(); lcd.print("Changing code"); delay(1000); lcd.clear(); lcd.print("Enter old code"); GetCode(); //verify the old code first so you can change it if(a==sizeof(code)){ //again verifying the a value lcd.clear(); lcd.print("Changing code"); GetNewCode1(); //Get the new code GetNewCode2(); //Get the new code again to confirm it s=0; for(i=0 ; i<sizeof(code) ; i++){ //Compare codes in array 1 and array 2 from two previous functions if(code_buff1[i]==code_buff2[i]) s++; //again this how we verifiy, increment s whenever codes are matching } if(s==sizeof(code)){ //Correct is always the size of the array for(i=0 ; i<sizeof(code) ; i++){ code[i]=code_buff2[i]; //the code array now receives the new code EEPROM.put(i, code[i]); //And stores it in the EEPROM } lcd.clear(); lcd.print("Code Changed"); delay(2000); } else{ //In case the new codes aren't matching lcd.clear(); lcd.print("Codes are not"); lcd.setCursor(0,1); lcd.print("matching !!"); delay(2000); } } else{ //In case the old code is wrong you can't change it lcd.clear(); lcd.print("Wrong"); delay(2000); } } void GetNewCode1(){ i=0; j=0; lcd.clear(); lcd.print("Enter new code"); //tell the user to enter the new code and press A lcd.setCursor(0,1); lcd.print("and press A"); delay(2000); lcd.clear(); lcd.setCursor(0,1); lcd.print("and press A"); //Press A keep showing while the top row print *** while(keypressed != 'A'){ //A to confirm and quits the loop keypressed = myKeypad.getKey(); if(keypressed != NO_KEY && keypressed != 'A' ){ lcd.setCursor(j,0); lcd.print("*"); //On the new code you can show * as I did or change it to keypressed to show the keys code_buff1[i]=keypressed; //Store caracters in the array i++; j++; } } keypressed = NO_KEY; } void GetNewCode2(){ //This is exactly like the GetNewCode1 function but this time the code is stored in another array i=0; j=0; lcd.clear(); lcd.print("Confirm code"); lcd.setCursor(0,1); lcd.print("and press A"); delay(3000); lcd.clear(); lcd.setCursor(0,1); lcd.print("and press A"); while(keypressed != 'A'){ keypressed = myKeypad.getKey(); if(keypressed != NO_KEY && keypressed != 'A' ){ lcd.setCursor(j,0); lcd.print("*"); code_buff2[i]=keypressed; i++; j++; } } keypressed = NO_KEY; } void OpenDoor(){ //Lock opening function open for 3s lcd.clear(); lcd.print("Welcome"); //With a message printed digitalWrite(Solenoid,HIGH); delay(3000); digitalWrite(Solenoid,LOW); `}`
Anonymous user
2 years ago
dear friend can you help me this project
Anonymous user
3 years ago
Heya, I just found this awesome project! Now I am scratching parts together and starting to set up. Question comes to mind, is it possible to make it work with a magnetic lock? Photo 2 The wiring are lookin OK to my mind. Magnetic lock is connected to relay and yeye?! I have found a lock but the seller is not highly rated, so if some one could help me to tell some place in Europe, where is it possible to buy that type of magnetic lock??? I got these parts: - UNO R3 - LCD i²c - 4x4 keypad matrix - one channel relay - normal switch Boxes I have to buy also to make it look like a "pro" :) This project is for my daughter and her room door locking... Parents are not welcome at teens home, hehehe! So familiar... So is there anything I should know before starting action?? All help and advice is welcome and high hat for person who do so!!! Music link to you all DIY Peoples :) https://www.youtube.com/watch?v=r_DebdQ2DLM&t=501s Kindly, robingood Finland
Anonymous user
3 years ago
Thanks A lottttt for saving my time....Really i was searching for this code...very clearly Explained with comment on each line ...very very useful ...
usamarasheed777
3 years ago
Arduino: 1.8.19 (Windows Store 1.8.57.0) (Windows 10), Board: "Arduino Uno" Keypad_doorlock_relay:48:80: error: no matching function for call to 'LiquidCrystal_I2C::LiquidCrystal_I2C(int, int, int, int, int, int, int, int)' LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin); ^ In file included from C:\\Users\\usama\\Downloads\\Keypad_doorlock_relay\\Keypad_doorlock_relay.ino:11:0: C:\\Users\\usama\\OneDrive\\Documents\\Arduino\\libraries\\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:57:3: note: candidate: LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t, uint8_t, uint8_t) LiquidCrystal_I2C(uint8_t lcd_Addr,uint8_t lcd_cols,uint8_t lcd_rows); ^~~~~~~~~~~~~~~~~ C:\\Users\\usama\\OneDrive\\Documents\\Arduino\\libraries\\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:57:3: note: candidate expects 3 arguments, 8 provided C:\\Users\\usama\\OneDrive\\Documents\\Arduino\\libraries\\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:55:7: note: candidate: constexpr LiquidCrystal_I2C::LiquidCrystal_I2C(const LiquidCrystal_I2C&) class LiquidCrystal_I2C : public Print { ^~~~~~~~~~~~~~~~~ C:\\Users\\usama\\OneDrive\\Documents\\Arduino\\libraries\\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:55:7: note: candidate expects 1 argument, 8 provided C:\\Users\\usama\\OneDrive\\Documents\\Arduino\\libraries\\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:55:7: note: candidate: constexpr LiquidCrystal_I2C::LiquidCrystal_I2C(LiquidCrystal_I2C&&) C:\\Users\\usama\\OneDrive\\Documents\\Arduino\\libraries\\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:55:7: note: candidate expects 1 argument, 8 provided C:\\Users\\usama\\Downloads\\Keypad_doorlock_relay\\Keypad_doorlock_relay.ino: In function 'void setup()': Keypad_doorlock_relay:54:15: error: 'class LiquidCrystal_I2C' has no member named 'setBacklightPin'; did you mean 'setBacklight'? lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE); ^~~~~~~~~~~~~~~ setBacklight Keypad_doorlock_relay:54:45: error: 'POSITIVE' was not declared in this scope lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE); ^~~~~~~~ exit status 1 no matching function for call to 'LiquidCrystal_I2C::LiquidCrystal_I2C(int, int, int, int, int, int, int, int)' This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.
iplaysax226
3 years ago
how would i adapt this to use a servo or stepper to open the lock/door?
Anonymous user
3 years ago
please i have a problem with the sketch, the <Keypad.h> was not found so i change it to <Adafruit_Keypad.h> and have this error 'class Adafruit_Keypad' has no member named 'getKey' please someone shound help me out
Anonymous user
4 years ago
Hello and thanks for making this project I have a question !!! Can I use of a 5vDc relay? Please help me , it's important
Anonymous user
4 years ago
Hello all. I am trying to submit a version of the project with relay wiring. I connected everything according to the schematic, but when I try to compile the project I have a lot of errors, it seems to me that the content of the LiquidCrystal_I2C library has changed and therefore refuses to compile: / Did anyone handle this problem? I am pasting the compile error log below(I'm from Poland, so some part of code is in polish, but it shouldn't be a problem:) ): Arduino:1.8.13 (Windows Store 1.8.42.0) (Windows 10), Płytka:"Arduino Uno" C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\arduino-builder -dump-prefs -logger=machine -hardware C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware -tools C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\ ools-builder -tools C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\ ools\\avr -built-in-libraries C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\libraries -libraries C:\\Users\\lukas\\Documents\\Arduino\\libraries -fqbn=arduino:avr:uno -ide-version=10813 -build-path C:\\Users\\lukas\\AppData\\Local\\Temp\\arduino_build_833409 -warnings=none -build-cache C:\\Users\\lukas\\AppData\\Local\\Temp\\arduino_cache_783851 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\ ools\\avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\ ools\\avr -prefs=runtime.tools.avrdude.path=C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\ ools\\avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\ ools\\avr -prefs=runtime.tools.avr-gcc.path=C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\ ools\\avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\ ools\\avr -verbose C:\\Users\\lukas\\Documents\\Arduino\\prototyp1\\prototyp1.ino C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\arduino-builder -compile -logger=machine -hardware C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware -tools C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\ ools-builder -tools C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\ ools\\avr -built-in-libraries C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\libraries -libraries C:\\Users\\lukas\\Documents\\Arduino\\libraries -fqbn=arduino:avr:uno -ide-version=10813 -build-path C:\\Users\\lukas\\AppData\\Local\\Temp\\arduino_build_833409 -warnings=none -build-cache C:\\Users\\lukas\\AppData\\Local\\Temp\\arduino_cache_783851 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\ ools\\avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\ ools\\avr -prefs=runtime.tools.avrdude.path=C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\ ools\\avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\ ools\\avr -prefs=runtime.tools.avr-gcc.path=C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\ ools\\avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\ ools\\avr -verbose C:\\Users\\lukas\\Documents\\Arduino\\prototyp1\\prototyp1.ino Using board 'uno' from platform in folder: C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\\arduino\\avr Using core 'arduino' from platform in folder: C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\\arduino\\avr Detecting libraries used... "C:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\ ools\\\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\cores\\\\arduino" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\variants\\\\standard" "C:\\\\Users\\\\lukas\\\\AppData\\\\Local\\\\Temp\\\\arduino_build_833409\\\\sketch\\\\prototyp1.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE Alternatives for Keypad.h: [Keypad-master@3.1.1 Keypad@3.1.0] ResolveLibrary(Keypad.h) -> candidates: [Keypad-master@3.1.1 Keypad@3.1.0] "C:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\ ools\\\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\cores\\\\arduino" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\variants\\\\standard" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\Keypad\\\\src" "C:\\\\Users\\\\lukas\\\\AppData\\\\Local\\\\Temp\\\\arduino_build_833409\\\\sketch\\\\prototyp1.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE Alternatives for EEPROM.h: [EEPROM@2.0] ResolveLibrary(EEPROM.h) -> candidates: [EEPROM@2.0] "C:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\ ools\\\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\cores\\\\arduino" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\variants\\\\standard" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\Keypad\\\\src" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\EEPROM\\\\src" "C:\\\\Users\\\\lukas\\\\AppData\\\\Local\\\\Temp\\\\arduino_build_833409\\\\sketch\\\\prototyp1.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE Alternatives for LiquidCrystal_I2C.h: [NewLiquidCrystal-master LiquidCrystal_I2C-1.1.2@1.1.2] ResolveLibrary(LiquidCrystal_I2C.h) -> candidates: [NewLiquidCrystal-master LiquidCrystal_I2C-1.1.2@1.1.2] "C:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\ ools\\\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\cores\\\\arduino" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\variants\\\\standard" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\Keypad\\\\src" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\EEPROM\\\\src" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\LiquidCrystal_I2C-1.1.2" "C:\\\\Users\\\\lukas\\\\AppData\\\\Local\\\\Temp\\\\arduino_build_833409\\\\sketch\\\\prototyp1.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE Alternatives for Wire.h: [Wire@1.0] ResolveLibrary(Wire.h) -> candidates: [Wire@1.0] "C:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\ ools\\\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\cores\\\\arduino" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\variants\\\\standard" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\Keypad\\\\src" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\EEPROM\\\\src" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\LiquidCrystal_I2C-1.1.2" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\Wire\\\\src" "C:\\\\Users\\\\lukas\\\\AppData\\\\Local\\\\Temp\\\\arduino_build_833409\\\\sketch\\\\prototyp1.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE "C:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\ ools\\\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\cores\\\\arduino" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\variants\\\\standard" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\Keypad\\\\src" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\EEPROM\\\\src" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\LiquidCrystal_I2C-1.1.2" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\Wire\\\\src" "C:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\Keypad\\\\src\\\\Key.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE "C:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\ ools\\\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\cores\\\\arduino" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\variants\\\\standard" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\Keypad\\\\src" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\EEPROM\\\\src" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\LiquidCrystal_I2C-1.1.2" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\Wire\\\\src" "C:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\Keypad\\\\src\\\\Keypad.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE "C:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\ ools\\\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\cores\\\\arduino" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\variants\\\\standard" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\Keypad\\\\src" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\EEPROM\\\\src" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\LiquidCrystal_I2C-1.1.2" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\Wire\\\\src" "C:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\LiquidCrystal_I2C-1.1.2\\\\LiquidCrystal_I2C.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE "C:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\ ools\\\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\cores\\\\arduino" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\variants\\\\standard" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\Keypad\\\\src" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\EEPROM\\\\src" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\LiquidCrystal_I2C-1.1.2" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\Wire\\\\src" "C:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\Wire\\\\src\\\\Wire.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE "C:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\ ools\\\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\cores\\\\arduino" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\variants\\\\standard" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\Keypad\\\\src" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\EEPROM\\\\src" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\LiquidCrystal_I2C-1.1.2" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\Wire\\\\src" "C:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\Wire\\\\src\\\\utility\\\ wi.c" -o nul -DARDUINO_LIB_DISCOVERY_PHASE Generating function prototypes... "C:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\ ools\\\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\cores\\\\arduino" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\variants\\\\standard" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\Keypad\\\\src" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\EEPROM\\\\src" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\LiquidCrystal_I2C-1.1.2" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\Wire\\\\src" "C:\\\\Users\\\\lukas\\\\AppData\\\\Local\\\\Temp\\\\arduino_build_833409\\\\sketch\\\\prototyp1.ino.cpp" -o "C:\\\\Users\\\\lukas\\\\AppData\\\\Local\\\\Temp\\\\arduino_build_833409\\\\preproc\\\\ctags_target_for_gcc_minus_e.cpp" -DARDUINO_LIB_DISCOVERY_PHASE "C:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\ ools-builder\\\\ctags\\\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\\\Users\\\\lukas\\\\AppData\\\\Local\\\\Temp\\\\arduino_build_833409\\\\preproc\\\\ctags_target_for_gcc_minus_e.cpp" Kompilowanie szkicu... "C:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\ ools\\\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\cores\\\\arduino" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\variants\\\\standard" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\Keypad\\\\src" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\EEPROM\\\\src" "-IC:\\\\Users\\\\lukas\\\\Documents\\\\Arduino\\\\libraries\\\\LiquidCrystal_I2C-1.1.2" "-IC:\\\\Program Files\\\\WindowsApps\\\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\\\hardware\\\\arduino\\\\avr\\\\libraries\\\\Wire\\\\src" "C:\\\\Users\\\\lukas\\\\AppData\\\\Local\\\\Temp\\\\arduino_build_833409\\\\sketch\\\\prototyp1.ino.cpp" -o "C:\\\\Users\\\\lukas\\\\AppData\\\\Local\\\\Temp\\\\arduino_build_833409\\\\sketch\\\\prototyp1.ino.cpp.o" prototyp1:40:80: error: no matching function for call to 'LiquidCrystal_I2C::LiquidCrystal_I2C(int, int, int, int, int, int, int, int)' LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin); ^ In file included from C:\\Users\\lukas\\Documents\\Arduino\\prototyp1\\prototyp1.ino:3:0: C:\\Users\\lukas\\Documents\\Arduino\\libraries\\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:57:3: note: candidate: LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t, uint8_t, uint8_t) LiquidCrystal_I2C(uint8_t lcd_Addr,uint8_t lcd_cols,uint8_t lcd_rows); ^~~~~~~~~~~~~~~~~ C:\\Users\\lukas\\Documents\\Arduino\\libraries\\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:57:3: note: candidate expects 3 arguments, 8 provided C:\\Users\\lukas\\Documents\\Arduino\\libraries\\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:55:7: note: candidate: constexpr LiquidCrystal_I2C::LiquidCrystal_I2C(const LiquidCrystal_I2C&) class LiquidCrystal_I2C : public Print { ^~~~~~~~~~~~~~~~~ C:\\Users\\lukas\\Documents\\Arduino\\libraries\\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:55:7: note: candidate expects 1 argument, 8 provided C:\\Users\\lukas\\Documents\\Arduino\\libraries\\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:55:7: note: candidate: constexpr LiquidCrystal_I2C::LiquidCrystal_I2C(LiquidCrystal_I2C&&) C:\\Users\\lukas\\Documents\\Arduino\\libraries\\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:55:7: note: candidate expects 1 argument, 8 provided C:\\Users\\lukas\\Documents\\Arduino\\prototyp1\\prototyp1.ino: In function 'void setup()': prototyp1:46:15: error: 'class LiquidCrystal_I2C' has no member named 'setBacklightPin'; did you mean 'setBacklight'? lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE); ^~~~~~~~~~~~~~~ setBacklight prototyp1:46:45: error: 'POSITIVE' was not declared in this scope lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE); ^~~~~~~~ Znaleziono wiele bibliotek w "LiquidCrystal_I2C.h" Wykorzystane: C:\\Users\\lukas\\Documents\\Arduino\\libraries\\LiquidCrystal_I2C-1.1.2 Niewykorzystane: C:\\Users\\lukas\\Documents\\Arduino\\libraries\\NewLiquidCrystal-master Znaleziono wiele bibliotek w "Keypad.h" Wykorzystane: C:\\Users\\lukas\\Documents\\Arduino\\libraries\\Keypad Niewykorzystane: C:\\Users\\lukas\\Documents\\Arduino\\libraries\\Keypad-master Użycie biblioteki Keypad w wersji 3.1.0 z folderu: C:\\Users\\lukas\\Documents\\Arduino\\libraries\\Keypad Użycie biblioteki EEPROM w wersji 2.0 z folderu: C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\\arduino\\avr\\libraries\\EEPROM Użycie biblioteki LiquidCrystal_I2C-1.1.2 w wersji 1.1.2 z folderu: C:\\Users\\lukas\\Documents\\Arduino\\libraries\\LiquidCrystal_I2C-1.1.2 Użycie biblioteki Wire w wersji 1.0 z folderu: C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\\arduino\\avr\\libraries\\Wire exit status 1 no matching function for call to 'LiquidCrystal_I2C::LiquidCrystal_I2C(int, int, int, int, int, int, int, int)'
Anonymous user
4 years ago
how to add commands so that we can delete characters such as pressing the back space before pressing the "A" button the following command doesn't work keypressed = myKeypad.getKey(); //Constantly waiting for a key to be pressed if(keypressed == '*'){ // * to open the lock lcd.clear(); lcd.setCursor(0,0); lcd.print("Enter code"); //Message to show GetCode(); //Getting code function if(a==sizeof(code)) //The GetCode function assign a value to a (it's correct when it has the size of the code array) OpenDoor(); //Open lock function if code is correct //I add here =========================== if(keypressed == 'C'){ //Clear Code lcd.clear(); //lcd.print("Standby"); //When done it returns to standby mode } //end==== else{ lcd.clear(); lcd.print("Wrong"); //Message to print when the code is wrong } delay(2000); lcd.clear(); lcd.print("Standby"); //Return to standby mode it's the message do display when waiting }
Anonymous user
4 years ago
dear friend can you help me this project
NoaLef
5 years ago
Does not work
Anonymous user
5 years ago
I am having lots of errors while compiling the code
Miragealarm
5 years ago
Super project!
Anonymous user
5 years ago
I have a problem in entering default code can anyone help?
Anonymous user
5 years ago
// here is the updated code, you need to download libraries : NewLiquidCrystal_1.5.1 and Keypad-master ``/* This code works with 4x4 Keypad Matrix, LCD ic, IRF510N transistor and a push button * It's a lock where the transistor drives a solenoid lock you can open either with correct code * or by the push button from inside * The code can be changed directly by the keypad and doesn't require uploading code again * Code is stored in EEPROM * Refer to www.surtrtech.com for more details */ #include <Keypad.h> #include <EEPROM.h> #include <LiquidCrystal_I2C.h> #define Solenoid 11 //Actually the Gate of the transistor that controls the solenoid #define O_Button 10 //Push Button #define I2C_ADDR 0x27 //I2C adress, you should use the code to scan the adress first (0x27) here #define BACKLIGHT_PIN 3 // Declaring LCD Pins #define En_pin 2 #define Rw_pin 1 #define Rs_pin 0 #define D4_pin 4 #define D5_pin 5 #define D6_pin 6 #define D7_pin 7 const byte numRows= 4; //number of rows on the keypad const byte numCols= 4; //number of columns on the keypad char keymap[numRows][numCols]= { {'1', '2', '3', 'A'}, {'4', '5', '6', 'B'}, {'7', '8', '9', 'C'}, {'*', '0', '#', 'D'} }; char keypressed; //Where the keys are stored it changes very often char code[]= {'6','6','0','1'}; //The default code, you can change it or make it a 'n' digits one char code_buff1[sizeof(code)]; //Where the new key is stored char code_buff2[sizeof(code)]; //Where the new key is stored again so it's compared to the previous one short a=0,i=0,s=0,j=0; //Variables used later byte rowPins[numRows] = {9,8,7,6}; //Rows 0 to 3 //if you modify your pins you should modify this too byte colPins[numCols]= {5,4,3,2}; //Columns 0 to 3 LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin); Keypad myKeypad= Keypad(makeKeymap(keymap), rowPins, colPins, numRows, numCols); void setup() { lcd.begin (16,2); // lcd.setBacklight(BACKLIGHT_PIN,POSITIVE); lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE); lcd.setBacklight(HIGH); //Lighting backlight lcd.home (); lcd.print("Standby"); //What's written on the LCD you can change pinMode(Solenoid,OUTPUT); pinMode(O_Button,INPUT); // for(i=0 ; i<sizeof(code);i++){ //When you upload the code the first time keep it commented // EEPROM.get(i, code[i]); //Upload the code and change it to store it in the EEPROM // } //Then uncomment this for loop and reupload the code (It's done only once) } void loop() { keypressed = myKeypad.getKey(); //Constantly waiting for a key to be pressed if(keypressed == '*'){ // * to open the lock lcd.clear(); lcd.setCursor(0,0); lcd.print("Enter code"); //Message to show GetCode(); //Getting code function if(a==sizeof(code)) //The GetCode function assign a value to a (it's correct when it has the size of the code array) OpenDoor(); //Open lock function if code is correct else{ lcd.clear(); lcd.print("Wrong"); //Message to print when the code is wrong } delay(2000); lcd.clear(); lcd.print("Standby"); //Return to standby mode it's the message do display when waiting } if(keypressed == '#'){ //To change the code it calls the changecode function ChangeCode(); lcd.clear(); lcd.print("Standby"); //When done it returns to standby mode } if(digitalRead(O_Button)==HIGH){ //Opening by the push button digitalWrite(Solenoid,HIGH); delay(3000); //Opens for 3s you can change digitalWrite(Solenoid,LOW); } } void GetCode(){ //Getting code sequence i=0; //All variables set to 0 a=0; j=0; while(keypressed != 'A'){ //The user press A to confirm the code otherwise he can keep typing keypressed = myKeypad.getKey(); if(keypressed != NO_KEY && keypressed != 'A' ){ //If the char typed isn't A and neither "nothing" lcd.setCursor(j,1); //This to write "*" on the LCD whenever a key is pressed it's position is controlled by j lcd.print("*"); j++; if(keypressed == code[i]&& i<sizeof(code)){ //if the char typed is correct a and i increments to verify the next caracter a++; //Now I think maybe I should have use only a or i ... too lazy to test it -_-' i++; } else a--; //if the character typed is wrong a decrements and cannot equal the size of code [] } } keypressed = NO_KEY; } void ChangeCode(){ //Change code sequence lcd.clear(); lcd.print("Changing code"); delay(1000); lcd.clear(); lcd.print("Enter old code"); GetCode(); //verify the old code first so you can change it if(a==sizeof(code)){ //again verifying the a value lcd.clear(); lcd.print("Changing code"); GetNewCode1(); //Get the new code GetNewCode2(); //Get the new code again to confirm it s=0; for(i=0 ; i<sizeof(code) ; i++){ //Compare codes in array 1 and array 2 from two previous functions if(code_buff1[i]==code_buff2[i]) s++; //again this how we verifiy, increment s whenever codes are matching } if(s==sizeof(code)){ //Correct is always the size of the array for(i=0 ; i<sizeof(code) ; i++){ code[i]=code_buff2[i]; //the code array now receives the new code EEPROM.put(i, code[i]); //And stores it in the EEPROM } lcd.clear(); lcd.print("Code Changed"); delay(2000); } else{ //In case the new codes aren't matching lcd.clear(); lcd.print("Codes are not"); lcd.setCursor(0,1); lcd.print("matching !!"); delay(2000); } } else{ //In case the old code is wrong you can't change it lcd.clear(); lcd.print("Wrong"); delay(2000); } } void GetNewCode1(){ i=0; j=0; lcd.clear(); lcd.print("Enter new code"); //tell the user to enter the new code and press A lcd.setCursor(0,1); lcd.print("and press A"); delay(2000); lcd.clear(); lcd.setCursor(0,1); lcd.print("and press A"); //Press A keep showing while the top row print *** while(keypressed != 'A'){ //A to confirm and quits the loop keypressed = myKeypad.getKey(); if(keypressed != NO_KEY && keypressed != 'A' ){ lcd.setCursor(j,0); lcd.print("*"); //On the new code you can show * as I did or change it to keypressed to show the keys code_buff1[i]=keypressed; //Store caracters in the array i++; j++; } } keypressed = NO_KEY; } void GetNewCode2(){ //This is exactly like the GetNewCode1 function but this time the code is stored in another array i=0; j=0; lcd.clear(); lcd.print("Confirm code"); lcd.setCursor(0,1); lcd.print("and press A"); delay(3000); lcd.clear(); lcd.setCursor(0,1); lcd.print("and press A"); while(keypressed != 'A'){ keypressed = myKeypad.getKey(); if(keypressed != NO_KEY && keypressed != 'A' ){ lcd.setCursor(j,0); lcd.print("*"); code_buff2[i]=keypressed; i++; j++; } } keypressed = NO_KEY; } void OpenDoor(){ //Lock opening function open for 3s lcd.clear(); lcd.print("Welcome"); //With a message printed digitalWrite(Solenoid,HIGH); delay(3000); digitalWrite(Solenoid,LOW); `}`
Anonymous user
5 years ago
There a part of the code where you say "Remember to upload the code first then uncomment line 62 to 64 and reupload, it's done only once." I think you meant "63 to 65" I am having problems with: "/tmp/136399509/keypad_4x4_and_lcd/keypad_4x4_and_lcd.ino:51:80: error: no matching function for call to 'LiquidCrystal_I2C::LiquidCrystal_I2C(int, int, int, int, int, int, int, int)' LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin); ^" my guess is that the library changed?.. there are multiple libraries with that name could you direct us to the one you use? Thanks
soupy747
6 years ago
thanks for taking the time to comment on nearly every line of code... as a beginner it was really helpful to me, made it super easy to tweak the code for my hardware.
Anonymous user
6 years ago
Hi, can you help me with my project?
Keypad Door Lock with Changeable Code | Arduino Project Hub
mane_er
8 months ago
Hello, i am your savior, if you are getting an error with compilating the LCD, that is because you dont have the EXACT same library as he does, the one that he uses is called Newliquidcrystal, and in his official web https://surtrtech.com/2019/04/12/arduino-door-lock-with-keypad-solenoid-relay-and-changeable-code/ you can find it down at the bottom where it says Libraries. Hope this helped. (sorry not so good at english)