VB6.0 :: Project security home | Project pertamakali dikampus

ini merupakan project kampus pertama saya, sebelum masuk team robotic, tugas akhir semeter 3, yah sederhana.. konsepnya gini, jika ada orang masuk melewati laser akan bunyi alarm dan jika ada gerakan mencurigakan di kebun akan ada alarm juga, cuma gitu sih.. hehe.. sistem pembuka pintunya pakai tombol, padahal rencana pakai wajah, berhubung waktu nggak cukup waktu itu ya sudahlah, pakai yg sederhana ini, dibawah ini bentuk aplikasinya :

dan dibawah ini bentuk prototypenya :

sedangkan untuk rangkaian elektronikannya bisa lihat disini :

dahulu masih pakai assambly, hehe… ini codennya :

Code Assambler:

org 0h

mulai:

mov a,p2

cjne a,#01111111b,led1

mov p0,#01111111b

sjmp mulai

 

led1:

cjne a,#10111111b,led2

mov p0,#10111111b

sjmp mulai

 

led2:

cjne a,#11011111b,led3

mov p0,#11011111b

sjmp mulai

 

led3:

cjne a,#11101111b,led4

mov p0,#11101111b

sjmp mulai

 

led4:

cjne a,#11110111b,led5

mov p0,#11110111b

sjmp mulai

 

led5:

cjne a,#11111011b,led6

mov p0,#11111011b

sjmp mulai

 

led6:

cjne a,#11111101b,led7

mov p0,#11111101b

sjmp mulai

 

led7:

cjne a,#11111110b,mulai

mov p0,#11111110b

sjmp mulai

end

untuk code visualnya dulu pakai VB6.0 karena belum ada materi VB.NET di kampus, dan aku sudah terbiasa dengan vb6.0.. dan assambly

compilernya masih pake ginian (gambar dibawah ini), microcontrollernya pake AT89s51/52 jadul banget..

code vb6.0nya ini :

VERSION 5.00
Object = “{648A5603-2C6E-101B-82B6-000000000014}#1.1#0”; “MSCOMM32.OCX”
Begin VB.Form KONEKSI
Caption = “KONEKSI SERIAL”
ClientHeight = 8760
ClientLeft = 2565
ClientTop = 1980
ClientWidth = 20250
Icon = “Form1.frx”:0000
LinkTopic = “Form1”
Picture = “Form1.frx”:4888A
ScaleHeight = 8760
ScaleWidth = 20250
WindowState = 2 ‘Maximized
Begin VB.Frame Frame4
BackColor = &H80000012&
BorderStyle = 0 ‘None
Caption = “KONTROL KEMANAN”
Height = 3135
Left = 15240
TabIndex = 16
Top = 4800
Width = 4695
Begin VB.TextBox Text5
Height = 375
IMEMode = 3 ‘DISABLE
Left = 360
PasswordChar = “*”
TabIndex = 25
Top = 720
Width = 3975
End
Begin VB.CommandButton Command8
Caption = ” KONTROL LAMPU”
Enabled = 0 ‘False
Height = 855
Left = 2520
TabIndex = 24
Top = 1320
Width = 1815
End
Begin VB.CommandButton Command5
Caption = “KONTROL KEAMANAN”
Enabled = 0 ‘False
Height = 855
Left = 360
TabIndex = 17
Top = 1320
Width = 1815
End
Begin VB.Label Label2
BackStyle = 0 ‘Transparent
Caption = “FITURE :”
ForeColor = &H8000000D&
Height = 255
Index = 5
Left = 360
TabIndex = 23
Top = 360
Width = 1575
End
End
Begin VB.Frame Frame3
BackColor = &H80000012&
BorderStyle = 0 ‘None
Caption = “PINTU”
Height = 3135
Left = 10320
TabIndex = 11
Top = 4800
Width = 4695
Begin VB.Timer Timer2
Interval = 1
Left = 1680
Top = 2640
End
Begin VB.CommandButton Command7
Caption = “TUTUP PINTU”
Enabled = 0 ‘False
Height = 855
Left = 2640
TabIndex = 14
Top = 1320
Width = 1815
End
Begin VB.CommandButton Command6
Caption = “BUKA PINTU”
Enabled = 0 ‘False
Height = 855
Left = 360
TabIndex = 13
Top = 1320
Width = 2055
End
Begin VB.TextBox Text4
Height = 375
IMEMode = 3 ‘DISABLE
Left = 360
PasswordChar = “*”
TabIndex = 12
Top = 720
Width = 4095
End
Begin VB.Label Label4
BackColor = &H8000000D&
BackStyle = 0 ‘Transparent
Caption = “AKSES PINTU :”
ForeColor = &H8000000D&
Height = 375
Left = 360
TabIndex = 15
Top = 360
Width = 1695
End
End
Begin VB.Frame Frame2
BackColor = &H80000012&
BorderStyle = 0 ‘None
Caption = “KONEKSI”
Height = 3135
Left = 480
TabIndex = 5
Top = 4800
Width = 4695
Begin VB.TextBox Text1
Height = 495
Left = 240
TabIndex = 9
Top = 1680
Width = 3015
End
Begin VB.CommandButton Command1
Caption = “KIRIM”
Height = 495
Left = 3360
TabIndex = 8
Top = 1680
Width = 1215
End
Begin VB.CommandButton Command2
Caption = “DISCONNECT”
Height = 735
Left = 2400
TabIndex = 7
Top = 480
Width = 2175
End
Begin VB.CommandButton Command3
Caption = “CONNECT”
Height = 735
Left = 240
TabIndex = 6
Top = 480
Width = 2055
End
Begin VB.Timer Timer1
Interval = 100
Left = 3960
Top = 2520
End
Begin MSCommLib.MSComm MSComm1
Left = 3480
Top = 2280
_ExtentX = 1005
_ExtentY = 1005
_Version = 393216
DTREnable = -1 ‘True
End
Begin VB.Label Label2
BackStyle = 0 ‘Transparent
Caption = “STATUS KONEKSI:”
ForeColor = &H8000000D&
Height = 255
Index = 3
Left = 240
TabIndex = 21
Top = 2400
Width = 1575
End
Begin VB.Label Label2
BackStyle = 0 ‘Transparent
Caption = “KONEKSI :”
ForeColor = &H8000000D&
Height = 255
Index = 2
Left = 240
TabIndex = 20
Top = 240
Width = 1575
End
Begin VB.Label Label2
BackStyle = 0 ‘Transparent
Caption = “TEST COMMAND:”
ForeColor = &H8000000D&
Height = 255
Index = 1
Left = 240
TabIndex = 19
Top = 1440
Width = 1575
End
Begin VB.Label Label3
AutoSize = -1 ‘True
BackStyle = 0 ‘Transparent
Caption = “>>”
ForeColor = &H8000000D&
Height = 195
Left = 360
TabIndex = 10
Top = 2640
Width = 180
End
End
Begin VB.Frame Frame1
BackColor = &H80000012&
BorderStyle = 0 ‘None
Caption = “SETTING”
Height = 3135
Left = 5400
TabIndex = 0
Top = 4800
Width = 4695
Begin VB.TextBox Text3
Height = 375
Left = 1200
TabIndex = 2
Text = “9600”
Top = 1560
Width = 1815
End
Begin VB.TextBox Text2
Height = 375
Left = 1200
TabIndex = 1
Text = “8”
Top = 960
Width = 1815
End
Begin VB.Label Label2
BackStyle = 0 ‘Transparent
Caption = “SETTING KONEKSI:”
ForeColor = &H8000000D&
Height = 255
Index = 4
Left = 120
TabIndex = 22
Top = 360
Width = 1575
End
Begin VB.Label Label2
BackStyle = 0 ‘Transparent
Caption = “baud rate :”
ForeColor = &H8000000D&
Height = 255
Index = 0
Left = 360
TabIndex = 4
Top = 1680
Width = 855
End
Begin VB.Label Label1
BackStyle = 0 ‘Transparent
Caption = “Com port :”
ForeColor = &H8000000D&
Height = 375
Left = 360
TabIndex = 3
Top = 960
Width = 855
End
End
Begin VB.Label Label6
AutoSize = -1 ‘True
BackStyle = 0 ‘Transparent
Caption = “SECURITY HOME”
BeginProperty Font
Name = “InvisibleKiller”
Size = 72
Charset = 0
Weight = 700
Underline = 0 ‘False
Italic = 0 ‘False
Strikethrough = 0 ‘False
EndProperty
Height = 1305
Left = 4320
TabIndex = 18
Top = 480
Width = 12390
End
End
Attribute VB_Name = “KONEKSI”
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim brate As Integer

Private Sub Command1_Click()
On Error GoTo er
MSComm1.Output = Text1.Text
Label3.Caption = “mengirim..”
Exit Sub
er:
Label3.Caption = “gagal koneksi”
End Sub

Private Sub Command2_Click()
On Error Resume Next
MSComm1.PortOpen = False
End Sub

Private Sub Command3_Click()
On Error GoTo er
MSComm1.CommPort = Text2.Text
MSComm1.PortOpen = True
Timer1.Enabled = True
Label3.Caption = “terkoneksi”
Exit Sub
er:
Label3.Caption = “tidak terkoneksi”
End Sub
Private Sub Command5_Click()
KAMERA.Visible = True
End Sub

Private Sub Form_Load()
MSComm1.RThreshold = 1
MSComm1.InputLen = 1
brate = Text3.Text
MSComm1.Settings = “9600,N,8,1”
MSComm1.DTREnable = False
End Sub

Private Sub Timer2_Timer()
If Text4.Text = “password” Then
Command6.Enabled = True
Command7.Enabled = True
End If

If Text5.Text = “password” Then
Command5.Enabled = True
Command8.Enabled = True
End If

End Sub

 

 

form2nya ini :

 

 

VERSION 5.00
Begin VB.Form Form2
BorderStyle = 1 ‘Fixed Single
Caption = “SETTING”
ClientHeight = 3030
ClientLeft = 9075
ClientTop = 4725
ClientWidth = 4710
LinkTopic = “Form2”
MaxButton = 0 ‘False
MinButton = 0 ‘False
ScaleHeight = 3030
ScaleWidth = 4710
Begin VB.CommandButton Command1
Caption = “SAVE”
Height = 735
Left = 240
TabIndex = 2
Top = 1200
Width = 1335
End
Begin VB.TextBox Text1
Height = 375
Left = 240
TabIndex = 1
Top = 720
Width = 4335
End
Begin VB.Label Label1
Caption = “NADA ALARM :”
Height = 375
Left = 240
TabIndex = 0
Top = 360
Width = 1335
End
End
Attribute VB_Name = “Form2”
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Me.Visible = False
End Sub

Please follow and like us:
10

Leave a Reply

Your email address will not be published. Required fields are marked *