1. Kondisi
Ketika ditekan angka 5 pada keypad, muncul tulisan "Teknik Elektro Unand"
2. Rangkaian Simulasi
3. Flowchart
4. Listing Program
#include <LiquidCrystal.h>
#include <Keypad.h>
const byte ROWS = 4;
const byte COLS = 3;
char keys[ROWS][COLS] = {
{'1', '2', '3'},
{'4', '5', '6'},
{'7', '8', '9'},
{'*', '0', '#'}
};
byte rowPins[ROWS] = {10, 9, 8, 7};
byte colPins[COLS] = {13, 12, 11};
LiquidCrystal lcd(A0, A1, A2, A3, A4, A5);
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
void setup() {
// Set baris dan kolom LCD lcd.begin(20, 4);
lcd.setCursor(1, 2);
lcd.setCursor(4, 3);
lcd.setCursor(0, 0);
}
void loop() {
char key = keypad.getKey();
if (key) { lcd.print(key);
if (key = "5"){
lcd.print("Teknik Elektro Unand")
}
}
}
#include <Keypad.h>
const byte ROWS = 4;
const byte COLS = 3;
char keys[ROWS][COLS] = {
{'1', '2', '3'},
{'4', '5', '6'},
{'7', '8', '9'},
{'*', '0', '#'}
};
byte rowPins[ROWS] = {10, 9, 8, 7};
byte colPins[COLS] = {13, 12, 11};
LiquidCrystal lcd(A0, A1, A2, A3, A4, A5);
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
void setup() {
// Set baris dan kolom LCD lcd.begin(20, 4);
lcd.setCursor(1, 2);
lcd.setCursor(4, 3);
lcd.setCursor(0, 0);
}
void loop() {
char key = keypad.getKey();
if (key) { lcd.print(key);
if (key = "5"){
lcd.print("Teknik Elektro Unand")
}
}
}
Tidak ada komentar:
Posting Komentar