Latest Updates

Kontrol Led Port Paralel dengan Visual Basic 6.0

Kontrol Led Port Paralel dengan Visual Basic 6.0



Untuk mengakses port pararel kita perlu interface untuk mengakses port paralel berikut tutorial nya


Disini saya akan memberikan tutorial tentang kontrol led port parelel dengan visual basic.
Dari data D0 – D7 .semoga bermanfaat.


1.PERTAMA BUAT TAMPILAN FORM DENGAN MEMILIH BUTTON DAN LABEL PADA GENERAL.


DAN UBAH CAPTION PADA ALFABETIC.
2.CLIK DOUBLE KLIK PADA BUTTON ON DAN ISIKAN KODE SEPERTI PADA GAMBAR.

3.SELANJUTNYA DOUBLE CLIK PADA BUTTON OFF DAN ISI KODE SEPERTI GAMBAR DIBAWAH

4.DAN SETERUSNYA CLIK BUTTON ON DAN OFF SELANJUTNYA SEPERTI LISTING PROGRAM KESELURUHAN PROGRAM DI BAWAH INI :
LISTING PROGRAM :
Private Sub KELUAR_Click()
Unload Me
End Sub

Private Sub LED1OFF_Click()
ClrPortBit &H378, 0
Label1.ForeColor = vbBlack
End Sub

Private Sub LED1ON_Click()
SetPortBit &H378, 0
Label1.ForeColor = vbRed
End Sub

Private Sub LED2OFF_Click()
ClrPortBit &H378, 1
Label2.ForeColor = vbBlack
End Sub

Private Sub LED2ON_Click()
SetPortBit &H378, 1
Label2.ForeColor = vbRed
End Sub

Private Sub LED3OFF_Click()
ClrPortBit &H378, 2
Label3.ForeColor = vbBlack
End Sub

Private Sub LED3ON_Click()
SetPortBit &H378, 2
Label3.ForeColor = vbRed
End Sub

Private Sub LED4OFF_Click()
ClrPortBit &H378, 3
Label4.ForeColor = vbBlack
End Sub

Private Sub LED4ON_Click()
SetPortBit &H378, 3
Label4.ForeColor = vbRed
End Sub

Private Sub LED5OFF_Click()
ClrPortBit &H378, 4
Label5.ForeColor = vbBlack
End Sub

Private Sub LED5ON_Click()
SetPortBit &H378, 4
Label5.ForeColor = vbRed
End Sub

Private Sub LED6OFF_Click()
ClrPortBit &H378, 5
Label6.ForeColor = vbBlack
End Sub

Private Sub LED6ON_Click()
SetPortBit &H378, 5
Label6.ForeColor = vbRed
End Sub

Private Sub LED7OFF_Click()
ClrPortBit &H378, 6
Label7.ForeColor = vbBlack
End Sub

Private Sub LED7ON_Click()
SetPortBit &H378, 6
Label7.ForeColor = vbRed
End Sub

Private Sub LED8OFF_Click()
ClrPortBit &H378, 7
Label8.ForeColor = vbBlack
End Sub

Private Sub LED8ON_Click()
SetPortBit &H378, 7
Label8.ForeColor = vbRed
End Sub

Private Sub OFF_ALL_Click()
PortOut &H378, &H0

Label1.ForeColor = vbBlack
Label2.ForeColor = vbBlack
Label3.ForeColor = vbBlack
Label4.ForeColor = vbBlack
Label5.ForeColor = vbBlack
Label6.ForeColor = vbBlack
Label7.ForeColor = vbBlack
Label8.ForeColor = vbBlack
End Sub
Private Sub ON_ALL_Click()
PortOut &H378, &HFF
Label1.ForeColor = vbRed
Label2.ForeColor = vbRed
Label3.ForeColor = vbRed
Label4.ForeColor = vbRed
Label5.ForeColor = vbRed
Label6.ForeColor = vbRed
Label7.ForeColor = vbRed
Label8.ForeColor = vbRed

End Sub

untuk videonya akan menyusul

0 Response to "Kontrol Led Port Paralel dengan Visual Basic 6.0"

Post a Comment