0% found this document useful (0 votes)
34 views9 pages

PROJETGEII3

This document contains code for an Arduino project that uses a liquid crystal display (LCD) and keypad to display a menu. The menu allows navigating between options to modify a password, select security modes, and enter an old password. The code initializes the LCD and keypad, defines a menu function to display options, and a sub-menu function to handle navigation and input.

Uploaded by

Lamenace Qataris
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views9 pages

PROJETGEII3

This document contains code for an Arduino project that uses a liquid crystal display (LCD) and keypad to display a menu. The menu allows navigating between options to modify a password, select security modes, and enter an old password. The code initializes the LCD and keypad, defines a menu function to display options, and a sub-menu function to handle navigation and input.

Uploaded by

Lamenace Qataris
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 9

#include "LiquidCrystal.

h"

#include "Keypad.h"

LiquidCrystal lcd(13,12,11,10,9,8);

const int col=4;

const int lign=4;

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

byte pin_rows[lign]={7,6,5,4};

byte pin_colum[col]={3,2,1,0};

Keypad Tap=Keypad(makeKeymap(keys),pin_rows,pin_colum,lign,col);

int i=0; int j=0;

char key;

char choix;

char updown;

void MENU();

void Sous_Menu();

char* MS[3]={'MODE S1','MODE S2','MODE S3'};

int k=0;

void setup()

lcd.begin(16,2);

lcd.setCursor(0,0);
lcd.print(" --BIENVENUE!-- ");

delay(200);

lcd.clear();

lcd.setCursor(3,0);

lcd.print("PRESS MENU");

lcd.setCursor(0,1);

lcd.print("TO CONFIG SYSTEM");

void loop()

key=Tap.getKey();

if(key)

{if(key=='C')

{MENU();

void MENU()

while(choix=Tap.getKey(),choix !='#'&&choix !='B')

{
{

lcd.setCursor(0,0);

lcd.setCursor(0,0);

lcd.print(">Modifier MDP ");

lcd.setCursor(0,1);

lcd.print(" Modes securite ");

delay(100);

if(choix=='B')

{lcd.clear();

lcd.setCursor(0,1);

lcd.print("> ");

lcd.setCursor(1,0);

lcd.print("Modifier MDP ");

lcd.setCursor(1,1);

lcd.print("Modes securite ");

while(updown=Tap.getKey(),updown !='#'||updown !='#')

if(updown=='A')

{ j=0;

i=0;

lcd.clear();
lcd.setCursor(0,0);

lcd.print("> ");

lcd.setCursor(1,0);

lcd.print("Modifier MDP ");

lcd.setCursor(1,1);

lcd.print("Modes securite ");

i++;

updown=Tap.getKey();

else if(updown=='B')

{ i=0;

j=0;

lcd.clear();

lcd.setCursor(0,1);

lcd.print("> ");

lcd.setCursor(1,0);

lcd.print("Modifier MDP ");

lcd.setCursor(1,1);

lcd.print("Modes securite ");

j++;

updown=Tap.getKey();

if(choix=='#')

{i=0;
j=0;

Sous_Menu();

void Sous_Menu()

while(key=Tap.getKey(),updown=='#'||choix=='#')

{if(i==1 && j==0)

lcd.setCursor(0,0);

lcd.print(" Ancien MDP ");

lcd.setCursor(0,1);

lcd.print(" ");

lcd.setCursor(0,1);

lcd.blink();

delay(200);

else if(i==0 && j==1)

{while(key=Tap.getKey(), key !='#'||key !='*' )

lcd.setCursor(0,0);

lcd.print("> ");

lcd.setCursor(1,0);
lcd.print("Mode S1 ");

lcd.setCursor(0,1);

lcd.print(" Modes S2 ");

if(key=='B')

{k=1;

lcd.setCursor(0,0);

lcd.print(" Mode S1 ");

lcd.setCursor(0,1);

lcd.print("> ");

lcd.setCursor(1,1);

lcd.print("Modes S2 ");

while(key='a',key=Tap.getKey(),key !='#'||key !='*')

{if(key='B')

{k=2;

lcd.setCursor(0,0);

lcd.print(" Mode S2 ");

lcd.setCursor(0,1);

lcd.print("> ");

lcd.setCursor(1,1);

lcd.print("Mode S3");

else if(key=='A')

break;

}
else if(key=='A')

{while(key='c',key=Tap.getKey(),key !='#'||key !='*')

{if(key=='A')

{if(k==1)

{lcd.setCursor(0,0);

lcd.print("> ");

lcd.setCursor(1,0);

lcd.print("Mode S1 ");

lcd.setCursor(0,1);

lcd.print(" Modes S2 ");

else if(k==2)

{lcd.setCursor(0,0);

lcd.print("> ");

lcd.setCursor(1,0);

lcd.print("Mode S2 ");

lcd.setCursor(0,1);

lcd.print(" Mode S3 ");

else

{lcd.setCursor(0,0);

lcd.print("> ");

lcd.setCursor(1,0);

lcd.print("Mode S1 ");

lcd.setCursor(0,1);
lcd.print(" Modes S2 ");

else if(key=='B')

break;

else if(i==0 && j==0)

lcd.setCursor(0,0);

lcd.print(" Ancien MDP ");

lcd.setCursor(0,1);

lcd.print(" ");

lcd.setCursor(0,1);

lcd.blink();

delay(200);

else if(key=='*')

MENU();

}
}

You might also like