1#include <LiquidCrystal.h>
2#include <Keyboard.h>
3
4const int rs = 7, en = 8, d4 = 9, d5 = 10, d6 = 11, d7 = 12;
5LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
6
7int menu;
8int PrevMenuState;
9
10int IMPORTANTJUMPER = 3;
11int button = 2;
12
15
16int passwords = 2;
17
18void setup() {
19 lcd.begin(16, 2);
20 lcd.clear();
21
22 Serial.begin(9600);
23 pinMode(IMPORTANTJUMPER,INPUT_PULLUP);
24 pinMode(button,INPUT_PULLUP);
25 pinMode(A6,INPUT);
26 PrevMenuState = 2;
27
28}
29
30void loop() {
31
32 while (digitalRead(IMPORTANTJUMPER) == HIGH) {
33
34 Keyboard.end();
35 delay(500);
36 }
37
38 menu = map(analogRead(A6),0,1024,0,passwords);
39
40 if(menu != PrevMenuState){
41
42 lcd.clear();
43
44
45 if(menu == 0){
46 lcd.print("Your account which the password is for1");
47
48 }
49 if(menu == 1){
50 lcd.print("Your account which the password is for2");
51 }
52
55 PrevMenuState = menu;
56
57 }
58
59
60
61
62 if(digitalRead(button) == LOW){
63 if(menu == 0){
64 Keyboard.print("password1");
65 while(digitalRead(button) == LOW){}
66 }
67 if(menu == 1){
68 Keyboard.print("password2 ");
69 while(digitalRead(button) == LOW){}
70 }
71
76
77 }
78
79}
80