-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLCD.ino
84 lines (70 loc) · 1.56 KB
/
LCD.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// Objects
LiquidCrystal_PCF8574 lcd(lcdAddr); // set the LCD address to 0x27 for a 16 chars and 2 line display
// Functions
void lcdSetup(void) {
Wire.beginTransmission(lcdAddr);
if ( Wire.endTransmission() == 0 ) Serial.println(F("LCD OK"));
else Serial.println(F("LCD MISSING"));
lcd.begin(16,2);
lcd.noBlink();
lcdHomeMode();
}
void lcdHomeMode(void) {
lcd.setBacklight(0);
lcd.clear();
}
void lcdInsertPasswordMode(void) {
lcd.setBacklight(255);
lcd.setCursor(0,0);
lcd.print("Insert password");
}
void lcdPrint(String string, uint8_t col, uint8_t row) {
lcd.setCursor(col,row);
lcd.print(string);
}
void lcdPasswordDenied(void) {
lcd.clear();
lcd.setCursor(0,0);
lcd.print("WRONG PASSWORD!");
lcd.setCursor(0,1);
lcd.print("TRY AGAIN");
delay(2000);
lcdHomeMode();
}
void lcdPasswordAccepted(void) {
lcd.clear();
lcd.setCursor(0,0);
lcd.print("PASSWORD");
lcd.setCursor(0,1);
lcd.print("ACCEPTED");
delay(2000);
lcdHomeMode();
}
void lcdCardAccepted(void) {
lcd.clear();
lcd.setBacklight(255);
lcd.setCursor(0,0);
lcd.print("CARD");
lcd.setCursor(0,1);
lcd.print("ACCEPTED");
delay(2000);
lcdHomeMode();
}
void lcdCardDenied(void) {
lcd.clear();
lcd.setBacklight(255);
lcd.setCursor(0,0);
lcd.print("CARD");
lcd.setCursor(0,1);
lcd.print("DENIED");
delay(2000);
lcdHomeMode();
}
void lcdProcessingCard(void) {
lcd.clear();
lcd.setBacklight(255);
lcd.setCursor(0,0);
lcd.print("PROCESSING");
lcd.setCursor(0,1);
lcd.print("CARD");
}