Git Product home page Git Product logo

arduinolock's Introduction

ArduinoLock

Description:

This project is just the barebones. It's an 3X4 Matrix Numpad with an 4 rows x 20 characters display and a servo (optional).

Options:

  • Enable Changing the passcode while the pragram is running
  • Enable the servo (only usefull for testing purposes )
  • Enable the serial debug (only for test purposes or nerds :-) )

Explanation:

The code is pretty difficult when you don't split it into some parts:

  • The variable declarations
  • The initialisation of libraries
  • The functions that are used by other functions
  • The functions that are used in the main loop

How does the code work?

  • First we create all our variables (A lot at first but we use them all)
  • Seccond we initialise all our libraries
    • The keypad library requires us to give the Keymap (Where every key is positioned), how many rows and colloms there are and where the pins are connected to
    • The LCD library requires us to give some stuff too
    • The servo library requires us to create an attribute for our new servo
  • Functions:
    • The initialisation of the LCD Now to start the program we want to test if the lcd is fully functional by:
      • Enabeling, disabeling and reanabeling the backlight
      • Showing the start message on the screen
    • The ability to disable backlight afther 30 secconds
    • Getting the pressed key
    • Getting the code from user input
    • Check the code if it's correct or not
    • Open or close the lock
    • Read and write the stored code to eeprom memory
    • Getting a new code while the program is running
    • Comparing the to given codes and see if they match
  • Setup:
    • Getting the eeprom code
    • When enabled initialize the servo library to attach to the servo
    • Initialize the lcd
    • When enabled initialize the Serial communication
  • Main Loop:
    • Getting the keypress
    • When you are in the unlocked state and you press * the lock is going to close
    • When you are in the unlocked state and you press # the lock will enter "Change Passcode" state
    • Open the lock when the LockState in true same as Opened (Pretty straigth foreward isn't it)
    • Or getting user input to get the code.

arduinolock's People

Contributors

sani7 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.