Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 40 additions & 27 deletions challenge 5
Original file line number Diff line number Diff line change
@@ -1,36 +1,49 @@
#include <LiquidCrystal.h>
#include <Keypad.h>
//keboard
const byte rows = 4;
const byte columns = 4;
char Keys[rows][columns] = {
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, A4);
String password = "5421";
int temp;
int keypressed;

const byte ROWS=4;
const byte COL =4;
char keys[ROWS][COL] = {
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'},
};
byte rowPins[rows]={9,10,11,12};
byte colPins[columns]={A0,A1,A2,A3};
Keypad keypad = Keypad(makeKeymap(Keys),rowPins,colPins,rows,columns);
// with the arduino pin number it is connected to
LiquidCrystal lcd(2,3,4,5,6,7);
char str[4]={'1','2','3','4'};
{'*','0','#','D'}
};
byte rowPins[ROWS] = {A0,A1,A2,A3};
byte colPins[COL] = {10,9,8,7};
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COL );

void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 0);
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("password");
delay(1000);
lcd.clear();
lcd.print("ENT PSSD");
}

void loop() {

char key = keypad.getKey();
if(keypressed)
Serial.println(keypressed);
if(key)
{
if( keypressed == '1' || keypressed == '2' || keypressed == '4' || keypressed == '5' )
{
temp += keypressed;
lcd.print("1234");

}lcd.setCursor(0, 1);
lcd.print("wrong");





}
int counter = 0 ;
void loop()
{
char Key = keypad.getKey();
if (Key == str[counter])
counter++;
if(counter==4){
lcd.setCursor(0,0);
lcd.print("Facebook : 123abc");
}
}