Di malam yang penuh bintang kali ini saya akan menjelaskan tentang bagaimana cara membuat alat yang dikendalikan melalui wifi atau secara wireless, alat ini menggunakan modul serial to ethernet konverter yang bernama WIZ110SR, jadi mengubah data serial ke TCP-IP atau sebaliknya, sehingga kita bisa memanfaatkannya untuk kontrol benda atau kontrol robot. untuk itu haruslah memiliki sebuah router untuk access pointnya, berikut adalah penjelasan lebih jelasnya
a. VIDEO HASILNYA
b. Minimum System
c. Program Bascom AVR
$regfile = "m32def.dat"
$crystal = 16000000
$baud = 9600
Ddrd.6 = 1
Ddrd.7 = 1
Dim A As String * 1
Do
A = Waitkey()
Select Case A
Case "1" :
Portd.6 = 1
Case "2" :
Portd.7 = 1
Case "3" :
Portd.6 = 0
Case "4" :
Portd.7 = 0
End Select
Loop
$crystal = 16000000
$baud = 9600
Ddrd.6 = 1
Ddrd.7 = 1
Dim A As String * 1
Do
A = Waitkey()
Select Case A
Case "1" :
Portd.6 = 1
Case "2" :
Portd.7 = 1
Case "3" :
Portd.6 = 0
Case "4" :
Portd.7 = 0
End Select
Loop
d. Program VB 6
'//=====================
Private Sub Command1_Click()
Winsock.SendData ("1")
End Sub
Private Sub Command2_Click()
Winsock.SendData ("3")
End Sub
Private Sub Command3_Click()
Winsock.SendData ("2")
End Sub
Private Sub Command4_Click()
Winsock.SendData ("4")
End Sub
Private Sub Command5_Click()
On Error GoTo a
If Winsock.State <> sckClosed Then Winsock.Close
Winsock.RemoteHost = Text_IP
Winsock.RemotePort = Text_PORT
Winsock.Connect
Command5.Enabled = False
Command6.Enabled = True
Exit Sub
a:
MsgBox "error: " & Err.Description, vbCritical, "Error"
End Sub
Private Sub Command6_Click()
Winsock.Close
MsgBox ("Koneksi dengan Client selesai")
Command5.Enabled = True
Command6.Enabled = False
End Sub
Private Sub Winsock_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
Winsock.Accept requestID
End Sub
No comments:
Post a Comment