pranavmadhavaram
Published © GPL3+

Password reminder

Get all your password with on password

AdvancedFull instructions provided182
Password reminder

Things used in this project

Story

Read more

Schematics

website_10_CrjCbuUDpC.png

Code

Untitled file

Arduino
#include <LiquidCrystal.h>

#include <Keypad.h>

const int ROW_NUM = 4; //four rows
const int COLUMN_NUM = 4; //four columns

char keys[ROW_NUM][COLUMN_NUM] = {
  {'1','2','3', 'A'},
  {'4','5','6', 'B'},
  {'7','8','9', 'C'},
  {'*','0','#', 'D'}
};

byte pin_rows[ROW_NUM] = {3,6,7,8}; //connect to the row pinouts of the keypad
byte pin_column[COLUMN_NUM] = {9,10,1,13}; //connect to the column pinouts of the keypad

Keypad keypad = Keypad( makeKeymap(keys), pin_rows, pin_column, ROW_NUM, COLUMN_NUM );

String inputString;
long inputInt;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); 
void setup() {
  Serial.begin(9600);
  inputString.reserve(10);
 myservo.attach(10);// maximum number of digit for a number is 10, change if needed
}

void loop() {
  char key = keypad.getKey();

  if (key) {
    Serial.println(key);

    if (key >= '0' && key <= '9') {     // only act on numeric keys
      inputString += key;               // append new character to input string
    } else if (key == '#') {
      if (inputString.length() > 0) {
        inputInt = inputString.toInt(); // YOU GOT AN INTEGER NUMBER
        inputString = "";               // clear input
        // DO YOUR WORK HERE

      }
    } else if (key == '*') {
      inputString = "";                 // clear input-
    }
  }
  if (key==3456){
      myservo.write(90);
    
  }
  else{
    myservo.write(0);
  }
  }

Credits

pranavmadhavaram
16 projects • 1 follower

Comments