Nonton film barat dengan teknologi yang canggih, dan tanpa sengaja dapat hal menarik, yaitu sebuah ide, sebuah banker dengan password untuk membukanya, pengen buat hardwarenya tapi gak punya dana, so hanya bisa lewat simulasi aja.hehe tapi mudah-mudahan bisa terwujud hardwarenya.. so langsung aja, pertama-tama jangan lupa baca bismillah, dan berikut skemanya dalam bentuk sederhana
penjelasan tentang hardwarenya, jadi default password "080895" tanpa tanda kutip, masukan passwordnya terlebih dahulu lalu klik tombol enter, lalu akan loading beberapa saat, dan gate (saya menyebutnya seperti itu) dapat di akses melalui 3 tombol, 1. Open gate, 2. Close Gate, 3. Close System..
dan 3 tombol tersebut mempunyai syarat, Tombol Open Gate mempunyai syarat limit close aktif (Gate tertutup), di sini saya menggunakan tombol, kenyataannya menggunakan limit, dan Tombol Close Gate mempunyai syarat limit open aktif (Gate terbuka), dan Tombol Close System, mempunyai syarat limit close aktif, di karenakan ketika system kembali ke awal pintu harus tertutup dahulu... penjelasan singkatnya seperti itu, ada juga tombol untung mereset password (merubah password) yaitu rst...
tadinya mau menggunakan interface untuk mereset password, tapi dikarenakan software bascom (demo/beta) hanya bisa terbatas dalam pemrogramannya ( < 25%) biasa karena gratisan, so tidak jadi...hehe
untuk password menggunakan fasilitas EEPROM, dan untuk di software bascom ERAM... bisa baca Help Index pada software bascom untuk lebih jelasnya lagi
so langsung aja source codenya :
$regfile = "m16def.dat"
$crystal = 8000000
Declare Sub Keypad()
Declare Sub Konfirmasi()
Declare Sub If_true()
Declare Sub Sysreset()
Declare Sub Buffer()
Declare Sub Baca_temp()
Declare Sub Clean_up()
Declare Sub Temp_yes()
Config Lcd = 16 * 2
Config Lcdpin = Pin , Rs = Porta.0 , E = Porta.1 , Db4 = Porta.2 , _
Db5 = Porta.3 , Db6 = Porta.4 , Db7 = Porta.5
Ddrb = &HF0
Ddrc = &HFC
Ddrd = &H00
Portb = &HFF
Portc = &HFF
Portd = &HFF
Dim Temp As String * 16
Dim Temp_lcd As String * 16
Dim Temp_chr As String * 16
Dim Pass As Eram String * 16
Dim Pass1 As String * 16
Dim Kode As Byte
O1 Alias Portb.4
O2 Alias Portb.5
O3 Alias Portb.6
O4 Alias Portb.7
S1 Alias Pinb.0
S2 Alias Pinb.1
S3 Alias Pinb.2
S4 Alias Pinb.3
S_open Alias Pind.2
S_close Alias Pind.3
S_closesys Alias Pind.4
Mo Alias Portc.2
Mc Alias Portc.3
Lim_o Alias Pinc.0
Lim_c Alias Pinc.1
Mo = 0
Mc = 0
Reset_up:
Pass1 = Pass
If Pass1 = "" Then
Pass = "080895"
Goto Reset_up
End If
Kode = 0
Cursor Off
Main:
Cls
Locate 1 , 1
Lcd "Masukan Password"
Clean_up
Menu:
Do
If Kode = 0 Then
Konfirmasi
End If
If Kode = 1 Then
' Kode = 0
Cls
Locate 1 , 1
Lcd "loading ..."
Waitms 200
Temp = ""
For Kode = 1 To 16
Locate 2 , 1
Temp = Temp + "*"
Lcd Temp
Waitms 100
Next Kode
Kode = 0
Temp = ""
Wait 2
Cls
Locate 1 , 1
Lcd "Kendali Gate"
If_true
End If
Loop
'===================================
Sub Keypad()
Portb = &B11101111
If S1 = 0 And O1 = 0 Then Temp = "1"
If S2 = 0 And O1 = 0 Then Temp = "5"
If S3 = 0 And O1 = 0 Then Temp = "9"
If S4 = 0 And O1 = 0 Then Temp = "R"
Portb = &B11011111
If S1 = 0 And O2 = 0 Then Temp = "2"
If S2 = 0 And O2 = 0 Then Temp = "6"
If S3 = 0 And O2 = 0 Then Temp = "0"
If S4 = 0 And O2 = 0 Then Temp = "Y"
Portb = &B10111111
If S1 = 0 And O3 = 0 Then Temp = "3"
If S2 = 0 And O3 = 0 Then Temp = "7"
If S3 = 0 And O3 = 0 Then Temp = "y"
If S4 = 0 And O3 = 0 Then Temp = "N"
Portb = &B01111111
If S1 = 0 And O4 = 0 Then Temp = "4"
If S2 = 0 And O4 = 0 Then Temp = "8"
If S3 = 0 And O4 = 0 Then Temp = "clr"
If S4 = 0 And O4 = 0 Then Temp = "C"
End Sub
'===================================
Sub Konfirmasi()
Keypad
If Temp = "y" Then
If Temp_chr = Pass1 Then
Kode = 1
Cls
Goto Menu
Else
Cls
Locate 1 , 1
Lcd "password salah"
Wait 1
Goto Main
End If
End If
If Temp = "clr" Then
Buffer
Goto Main
End If
If Temp = "R" And Temp_chr = "" Then
Buffer
Sysreset
End If
Baca_temp
End Sub
'===================================
Sub Sysreset()
Cls
Locate 1 , 1
Lcd "are you sure to"
Locate 2 , 1
Lcd "reset password"
Do
Keypad
If Temp = "Y" Then
Buffer
Goto Reset1
End If
If Temp = "N" Then
Buffer
Goto Main
End If
Loop
Reset1:
Cls
Locate 1 , 1
Lcd "password lama"
Clean_up
Do
Keypad
If Temp = "y" Then
If Temp_chr = Pass1 Then
Buffer
Exit Do
Else
Cls
Lcd "password salah"
Wait 1
Goto Reset1
End If
End If
If Temp = "clr" Then
Buffer
Goto Reset1
End If
If Temp = "C" Then
Cls
Locate 1 , 1
Lcd "are you sure"
Locate 2 , 1
Lcd "to exit ?"
Do
Keypad
Temp_yes
If Temp = "N" Then
Buffer
Goto Reset1
End If
Loop
End If
Baca_temp
Loop
Reset_password:
Cls
Locate 1 , 1
Lcd "password baru"
Clean_up
Do
Keypad
If Temp = "y" And Temp_chr <> "" Then
Pass1 = Temp_chr
Buffer
Exit Do
End If
If Temp = "clr" Then
Buffer
Goto Reset_password
End If
If Temp = "C" Then
Cls
Locate 1 , 1
Lcd "are you sure"
Locate 2 , 1
Lcd "to exit ?"
Do
Keypad
Temp_yes
If Temp = "N" Then
Buffer
Goto Reset_password
End If
Loop
End If
Baca_temp
Loop
Reset_password2:
Cls
Locate 1 , 1
Lcd "confirmasi pass"
Clean_up
Do
Keypad
If Temp = "y" Then
If Pass1 = Temp_chr Then
Buffer
Exit Do
Else
Cls
Lcd "password tidak"
Locate 2 , 1
Lcd "sesuai"
Wait 1
Goto Reset_password
End If
End If
If Temp = "clr" Then
Buffer
Goto Reset_password2
End If
If Temp = "C" Then
Cls
Locate 1 , 1
Lcd "are you sure"
Locate 2 , 1
Lcd "to exit ?"
Do
Keypad
Temp_yes
If Temp = "N" Then
Buffer
Goto Reset_password2
End If
Loop
End If
Baca_temp
Loop
Cls
Locate 1 , 1
Lcd "processing"
Waitms 100
Temp = ""
For Kode = 1 To 16
Locate 2 , 1
Temp = Temp + "*"
Lcd Temp
Waitms 100
Next Kode
Kode = 0
Pass = Pass1
Cls
Lcd "pass berhasil"
Lowerline
Lcd "di rubah"
Wait 2
Goto Main
End Sub
'===================================
Sub If_true()
Do
If S_open = 0 And Lim_o = 1 And Lim_c = 0 Then
Mo = 1
Mc = 0
End If
If S_close = 0 And Lim_o = 0 And Lim_c = 1 Then
Mc = 1
Mo = 0
End If
If S_closesys = 0 And Lim_c = 0 Then
Locate 2 , 1
Lcd "Close System "
Wait 1
Cls
Locate 1 , 1
Lcd "Waiting 4 Close"
Waitms 200
Temp = ""
For Kode = 1 To 16
Locate 2 , 1
Temp = Temp + "*"
Lcd Temp
Waitms 100
Next Kode
Kode = 0
Temp = ""
Wait 2
Goto Main
End If
If Lim_o = 0 Then
Mo = 0
End If
If Lim_c = 0 Then
Mc = 0
End If
If Mo = 1 Then
Locate 2 , 1
Lcd "Open Gate" ; " "
End If
If Mc = 1 Then
Locate 2 , 1
Lcd "Close Gate" ; " "
End If
Loop
End Sub
'===================================
Sub Buffer()
O1 = 0
O2 = 0
O3 = 0
O4 = 0
Do
Loop Until S1 = 1 And S2 = 1 And S3 = 1 And S4 = 1
End Sub
'===================================
Sub Baca_temp()
If Temp <> "" And Temp <> "Y" And Temp <> "N" And Temp <> "C" And Temp <> "R" And Temp <> "y" Then
Temp_lcd = Temp_lcd + "*"
Temp_chr = Temp_chr + Temp
Locate 2 , 1
Lcd Temp_lcd
Temp = ""
Buffer
End If
End Sub
'===================================
Sub Clean_up()
Temp = ""
Temp_chr = ""
Temp_lcd = ""
End Sub
'===================================
Sub Temp_yes()
If Temp = "Y" Then
Buffer
Pass1 = Pass
Goto Main
End If
End Sub
$crystal = 8000000
Declare Sub Keypad()
Declare Sub Konfirmasi()
Declare Sub If_true()
Declare Sub Sysreset()
Declare Sub Buffer()
Declare Sub Baca_temp()
Declare Sub Clean_up()
Declare Sub Temp_yes()
Config Lcd = 16 * 2
Config Lcdpin = Pin , Rs = Porta.0 , E = Porta.1 , Db4 = Porta.2 , _
Db5 = Porta.3 , Db6 = Porta.4 , Db7 = Porta.5
Ddrb = &HF0
Ddrc = &HFC
Ddrd = &H00
Portb = &HFF
Portc = &HFF
Portd = &HFF
Dim Temp As String * 16
Dim Temp_lcd As String * 16
Dim Temp_chr As String * 16
Dim Pass As Eram String * 16
Dim Pass1 As String * 16
Dim Kode As Byte
O1 Alias Portb.4
O2 Alias Portb.5
O3 Alias Portb.6
O4 Alias Portb.7
S1 Alias Pinb.0
S2 Alias Pinb.1
S3 Alias Pinb.2
S4 Alias Pinb.3
S_open Alias Pind.2
S_close Alias Pind.3
S_closesys Alias Pind.4
Mo Alias Portc.2
Mc Alias Portc.3
Lim_o Alias Pinc.0
Lim_c Alias Pinc.1
Mo = 0
Mc = 0
Reset_up:
Pass1 = Pass
If Pass1 = "" Then
Pass = "080895"
Goto Reset_up
End If
Kode = 0
Cursor Off
Main:
Cls
Locate 1 , 1
Lcd "Masukan Password"
Clean_up
Menu:
Do
If Kode = 0 Then
Konfirmasi
End If
If Kode = 1 Then
' Kode = 0
Cls
Locate 1 , 1
Lcd "loading ..."
Waitms 200
Temp = ""
For Kode = 1 To 16
Locate 2 , 1
Temp = Temp + "*"
Lcd Temp
Waitms 100
Next Kode
Kode = 0
Temp = ""
Wait 2
Cls
Locate 1 , 1
Lcd "Kendali Gate"
If_true
End If
Loop
'===================================
Sub Keypad()
Portb = &B11101111
If S1 = 0 And O1 = 0 Then Temp = "1"
If S2 = 0 And O1 = 0 Then Temp = "5"
If S3 = 0 And O1 = 0 Then Temp = "9"
If S4 = 0 And O1 = 0 Then Temp = "R"
Portb = &B11011111
If S1 = 0 And O2 = 0 Then Temp = "2"
If S2 = 0 And O2 = 0 Then Temp = "6"
If S3 = 0 And O2 = 0 Then Temp = "0"
If S4 = 0 And O2 = 0 Then Temp = "Y"
Portb = &B10111111
If S1 = 0 And O3 = 0 Then Temp = "3"
If S2 = 0 And O3 = 0 Then Temp = "7"
If S3 = 0 And O3 = 0 Then Temp = "y"
If S4 = 0 And O3 = 0 Then Temp = "N"
Portb = &B01111111
If S1 = 0 And O4 = 0 Then Temp = "4"
If S2 = 0 And O4 = 0 Then Temp = "8"
If S3 = 0 And O4 = 0 Then Temp = "clr"
If S4 = 0 And O4 = 0 Then Temp = "C"
End Sub
'===================================
Sub Konfirmasi()
Keypad
If Temp = "y" Then
If Temp_chr = Pass1 Then
Kode = 1
Cls
Goto Menu
Else
Cls
Locate 1 , 1
Lcd "password salah"
Wait 1
Goto Main
End If
End If
If Temp = "clr" Then
Buffer
Goto Main
End If
If Temp = "R" And Temp_chr = "" Then
Buffer
Sysreset
End If
Baca_temp
End Sub
'===================================
Sub Sysreset()
Cls
Locate 1 , 1
Lcd "are you sure to"
Locate 2 , 1
Lcd "reset password"
Do
Keypad
If Temp = "Y" Then
Buffer
Goto Reset1
End If
If Temp = "N" Then
Buffer
Goto Main
End If
Loop
Reset1:
Cls
Locate 1 , 1
Lcd "password lama"
Clean_up
Do
Keypad
If Temp = "y" Then
If Temp_chr = Pass1 Then
Buffer
Exit Do
Else
Cls
Lcd "password salah"
Wait 1
Goto Reset1
End If
End If
If Temp = "clr" Then
Buffer
Goto Reset1
End If
If Temp = "C" Then
Cls
Locate 1 , 1
Lcd "are you sure"
Locate 2 , 1
Lcd "to exit ?"
Do
Keypad
Temp_yes
If Temp = "N" Then
Buffer
Goto Reset1
End If
Loop
End If
Baca_temp
Loop
Reset_password:
Cls
Locate 1 , 1
Lcd "password baru"
Clean_up
Do
Keypad
If Temp = "y" And Temp_chr <> "" Then
Pass1 = Temp_chr
Buffer
Exit Do
End If
If Temp = "clr" Then
Buffer
Goto Reset_password
End If
If Temp = "C" Then
Cls
Locate 1 , 1
Lcd "are you sure"
Locate 2 , 1
Lcd "to exit ?"
Do
Keypad
Temp_yes
If Temp = "N" Then
Buffer
Goto Reset_password
End If
Loop
End If
Baca_temp
Loop
Reset_password2:
Cls
Locate 1 , 1
Lcd "confirmasi pass"
Clean_up
Do
Keypad
If Temp = "y" Then
If Pass1 = Temp_chr Then
Buffer
Exit Do
Else
Cls
Lcd "password tidak"
Locate 2 , 1
Lcd "sesuai"
Wait 1
Goto Reset_password
End If
End If
If Temp = "clr" Then
Buffer
Goto Reset_password2
End If
If Temp = "C" Then
Cls
Locate 1 , 1
Lcd "are you sure"
Locate 2 , 1
Lcd "to exit ?"
Do
Keypad
Temp_yes
If Temp = "N" Then
Buffer
Goto Reset_password2
End If
Loop
End If
Baca_temp
Loop
Cls
Locate 1 , 1
Lcd "processing"
Waitms 100
Temp = ""
For Kode = 1 To 16
Locate 2 , 1
Temp = Temp + "*"
Lcd Temp
Waitms 100
Next Kode
Kode = 0
Pass = Pass1
Cls
Lcd "pass berhasil"
Lowerline
Lcd "di rubah"
Wait 2
Goto Main
End Sub
'===================================
Sub If_true()
Do
If S_open = 0 And Lim_o = 1 And Lim_c = 0 Then
Mo = 1
Mc = 0
End If
If S_close = 0 And Lim_o = 0 And Lim_c = 1 Then
Mc = 1
Mo = 0
End If
If S_closesys = 0 And Lim_c = 0 Then
Locate 2 , 1
Lcd "Close System "
Wait 1
Cls
Locate 1 , 1
Lcd "Waiting 4 Close"
Waitms 200
Temp = ""
For Kode = 1 To 16
Locate 2 , 1
Temp = Temp + "*"
Lcd Temp
Waitms 100
Next Kode
Kode = 0
Temp = ""
Wait 2
Goto Main
End If
If Lim_o = 0 Then
Mo = 0
End If
If Lim_c = 0 Then
Mc = 0
End If
If Mo = 1 Then
Locate 2 , 1
Lcd "Open Gate" ; " "
End If
If Mc = 1 Then
Locate 2 , 1
Lcd "Close Gate" ; " "
End If
Loop
End Sub
'===================================
Sub Buffer()
O1 = 0
O2 = 0
O3 = 0
O4 = 0
Do
Loop Until S1 = 1 And S2 = 1 And S3 = 1 And S4 = 1
End Sub
'===================================
Sub Baca_temp()
If Temp <> "" And Temp <> "Y" And Temp <> "N" And Temp <> "C" And Temp <> "R" And Temp <> "y" Then
Temp_lcd = Temp_lcd + "*"
Temp_chr = Temp_chr + Temp
Locate 2 , 1
Lcd Temp_lcd
Temp = ""
Buffer
End If
End Sub
'===================================
Sub Clean_up()
Temp = ""
Temp_chr = ""
Temp_lcd = ""
End Sub
'===================================
Sub Temp_yes()
If Temp = "Y" Then
Buffer
Pass1 = Pass
Goto Main
End If
End Sub
dan akhirnya selesai juga, jangan lupa baca "Alhamdulillah".. :)
moga bermanfaat bagi agan-agan yang ingin mencobanya,
moga berhasil mencobanya..
Download http://ouo.io/FPvgB7moga berhasil mencobanya..
password rar: ganyang-angkara.blogspot.com
*..sesama blogger harus saling menghargai, jika agan-agan ingin mengcopas harap cantumkan alamat urlnya, Terimakasih..*