Write a program that prompts the user for a 4digit login and
Write a program that prompts the user for a 4-digit login and password in the LCD. The user must enter the login and password information from the keypad. The information should be displayed as stars on the LCD. If the information entered is correct display \"Access Granted!\" else display \"Access Denied!\" The program must run in an infinite loop
Solution
Password Lock with Arduino:
This instructable will show you how to make a pass-code lock system using the Arduino Mega board.
 --->one Arduino Mega (the arduino uno or duemilianove does not have enough digital pins for this project)
 --->one LCD module
 --->one Keypad
 --->one Battery pack (or you can use the USB cable and PC power)
 --->one 10K Ohm potentiometer
 --->four 10K Ohm resistors
 ---> Breadboard
 ---> hookup wire.
The LCD module has 16 pins.
 First of all, connect pins 1 and 16 of the LCD to the ground rail on the Breadboard
 Then connect pins 2 and 15 of the LCD to the +5v rail on the breadboard.
 Now connect the ground rail(should be blue) of the breadboard to a ground pin on the Arduino;
 Connect the +5v rail of the breadboard(this one is red) to one of the +5v pins on the Arduino board.
 Now comes the contrast potentiometer which has to be connected to pin 3 of the LCD.
 The potentiometer will have 3 pins. Take the middle pin and connect it to pin 3 of the arduino with hookup wire. Connect the othere two pins one to +5v and the other to GND(ground). The order does not matter.
 
 Now let\'s do a test: power up the arduino. The LCD should light up. If it does then Great! If the LCD does not light up then turn off the power and check the wires.
 
 Never change, move, or take out wires from the circuit board when the Arduino is powered up. You may permanently damage the Arduino.
 
 If the light works rotate the potentiometer all the way to the right and all the way to the left until you see 2 rows of black squares. That\'s the contrast.
 
 Now take out the power and let\'s hook up the LCD to the Arduino with the signal wires so we can display something on it.
 Connect the pins as follows:
 LCD Pin 4 --> Arduino Pin 2
 LCD Pin 5 --> Arduino Pin 3
 LCD Pin 6 --> Arduino Pin 4
 LCD Pin 11 --> Arduino Pin 9
 LCD Pin 12 --> Arduino Pin 10
 LCD Pin 13 --> Arduino Pin 11
 LCD Pin 14 --> Arduino Pin 12
 program:
 #include <LiquidCrystal.h>
 
 // initialize the library with the numbers of the interface pins
 LiquidCrystal lcd(2,3,4,9,10,11,12);
 
 void setup() {
 // set up the LCD\'s number of columns and rows:
 lcd.begin(16, 2);
 // Print a message to the LCD.
 lcd.print(\"hello, world!\");
 }
 
 void loop() {
 // set the cursor to column 0, line 1
 // (note: line 1 is the second row, since counting begins with 0):
 lcd.setCursor(0, 1);
 // print the number of seconds since reset:
 lcd.print(millis()/1000);
 }

