Page 294 - 156-PENERAPAN_RANGKAIAN_ELEKTRONIKA
P. 294
PENERAPAN RANGKAIAN
ELEKTRONIKA
MATERI PEMBELAJARAN
//Menu 1
---------------
menu1:
customKey = keypad.getKey(); // Simpan tombol yang ditekan ke
variabel “costumKey”
LCD.clear(); // menghapus tampilan LCD
LCD.print(“Pilih menu :”); // Tampilkan pesan ke LCD
LCD.setCursor(0,1); // Kursor pada2 LCD.print(“1. Ganti
Pass 1”); // Tampilkan pesan ke LCD if
(customKey == ‘B’){ // Jika keypad B ditekan goto menu2;
// Menuju menu 2
}
else if (customKey == ‘#’ ){ // jika tombol # ditekan
LCD.clear(); // Menghapus tampilan
gantipassword(); // kerjakan void gantipasword
}
delay(200); // tunda 0,2 detik
goto menu1; // menuju menu1
//menu2
-----------
menu2:
customKey = keypad.getKey(); // Simpan tombol yang ditekan ke
variabel “costumKey”
LCD.clear(); // Hapus tampilan LCD LCD.
print(“Pilih menu :”);
// tampilkan pesan ke LCD LCD.
setCursor(0,1); // kursor pada2 LCD.print(“2.
Ganti Pass 2”); // tampilkan pesan ke LCD if
(customKey == ‘A’){
// jika tombol A ditekan
goto menu1; // menuju ke menu1
}
else if (customKey == ‘B’){ // jika tombol B ditekan
goto menu3; // menuju ke menu 3
}
else if (customKey == ‘#’ ){ // jika tombol # ditekan
LCD.clear(); // menghapus tampilan LCD
gantipassword2(); // kerjakan void gantipassword2
}
delay(200); // tunda 0,2 detik
goto menu2; // menuju menu 2
TEKNIK ELEKTRONIKA 279
INDUSTRI