Read more
Aplikasi Input output Membaca keypad 3x4 menggunakan mikrokontroler dengan bascom dan at mega 8535
Peralatan dengan Password
Skema rangkaian Aplikasi Input output Membaca keypad 3x4 menggunakan mikrokontroler dengan bascom dan at mega 8535
Peralatan dengan Password
Source code Aplikasi Input output Membaca keypad 3x4 menggunakan mikrokontroler dengan bascom dan at mega 8535
Peralatan dengan Password
$regfile =
"m8535.dat"
$crystal = 16000000
Config Lcdpin = Pin , Rs =
Portc.0 , E = Portc.2 , Db4 = Portc.4
Config Lcdpin = Pin , Db5 =
Portc.5 , Db6 = Portc.6 , Db7 = Portc.7
Config Lcd = 16 * 2
Cursor Off
Cls
Lcd "Masukan
Password"
Relay Alias Portd.0
Ddrd.0 = 1
Relay = 0
Config Kbd = Porta
Dim Keypad As Byte , C As
Byte
Dim Pw As String * 5 , Key
As String * 1
Const Password =
"1230"
Locate 2 , 4
Do
Keypad = Getkbd()
If Keypad <> 16 Then
Gosub get_keypad
Incr C
'If C <= 4 Then
Pw = Pw + Key
If C >= 4 Then
If Pw <> Password Then
Cls
Lcd "Password
Salah"
Wait 2
Cls
Lcd "Masukan
Pasword"
Locate 2 , 4
Pw = ""
C = 0
Else
Cls
Lcd "Password
Benar"
Lowerline
Lcd "Relay ON"
Relay = 1
End If
End If
Waitms 350
End If
Loop
End
Get_keypad:
Lcd "*"
Select Case Keypad
Case 19 : Key =
"0"
Case 0 : Key = "1"
Case 4 : Key = "2"
Case 8 : Key = "3"
Case 1 : Key = "4"
Case 5 : Key = "5"
Case 9 : Key = "6"
Case 2 : Key = "7"
Case 18 : Key =
"8"
Case 10 : Key =
"9"
Case 3 : Key = "*"
Case 11 : Key =
"#"
End Select
Return
End



0 Reviews
Silakan dikomentari