Arduino Leonardo - Electronical Lock Geplaatst op 2020-06-22 The Full program#include #include #include #include #include const bool EnablePasscodeChange = true;const bool EnableServo = false;const bool EnableDebug = true;const unsigned long MaxNoActivitySec = 30;const unsigned long MaxNoActivityMillis = MaxNoActivitySec * 1000;unsigned char PasscodeLength;unsigned char Eeprom_PasscodeLength = 0;const unsigned char MaxPasscodeLength = 19;char Data[MaxPasscodeLength];char Master[MaxPasscodeLength];unsigned char data_count = 0;char Key;bool LockState = false;unsigned long TimeLastActivity = 0;unsigned long TimeNoActivity = 0;bool LCDBacklightState = true;char code_buff1[MaxPasscodeLength];unsigned char dataCountBuff1 = 0;char code_buff2[MaxPasscodeLength];unsigned char dataCountBuff2 = 0;unsigned char NewPasscodeLength = 0;const unsigned char ROWS = 4;const unsigned char COLS = 3;char KeyMap[ROWS][COLS] = ;byte rowPins[ROWS] = ;byte colPins[COLS] = ;Keypad customKeypad = Keypad(makeKeymap(KeyMap), rowPins, colPins, ROWS, COLS);// set the LCD address to 0x27 for a 20 chars 4 line display// Set the pins on the I2C chip used for LCD connections:// addr, en,rw,rs,d4,d5,d6,d7,bl,blpolLiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);Servo Lock;void InitializationLCD() void BackLightTest() void ActivityCheck() 1void ActivityReset() void Backlight(bool state) void clearData()1char WaitForKey() 1void GetCode() 1void CodeCorrect() void CodeIncorrect() void CheckCode() 1void OpenLock() void CloseLock() 1void GetEepromCode() void WriteEepromCode()void CheckNewCode() 1void ChangeCode() void setup() void loop() Vorige pagina 10. The code - part 5 - Setup and Loop Huidige pagina 11. The full code 1. Introduction 2. The Schematic 3. The Keypad 4. The LCD module 5. The servo 6. The code - part 1 - The Keypad 7. The code - part 2 - The LCD 8. The code - part 3 - The code 9. The code - part 4 - More codes 10. The code - part 5 - Setup and Loop 11. The full code Geschreven door Sander Speetjens Reacties Arduino Leonardo - clone I2C LCD interface module 20x4 Karakters lcd module blauw 4x4 Button keypad FEETECH High-Torque Servo FS5115M