Hi, i am new to VB.NET and i am doing my final year project on VB.NET. I have completed half of my application but i have no idea that how to interface at89s52 with my application via wifi. I have an application that was written in VB6 this application will interface the kit through the wifi and take the value from at89s52 micro controller. I have the code to interface it but it was written on vb6 and i don't know how to write an equivalent code in VB.NET.
Dim j, FL As Integer
Dim I As Long
Dim a As String
Dim x, y, x1 As Integer
Dim a1, b1, c1, a2, b2, c2, d1, d2, cc, ff As Integer
Private Sub Command1_Click()
MSComm1.Output = "C"
End Sub
Private Sub Command10_Click()
Winsock1.SendData "BB"
End Sub
Private Sub Command11_Click()
Winsock1.SendData "DD"
End Sub
Private Sub Command2_Click()
MSComm1.Output = "D"
End Sub
Private Sub Command3_Click()
MSComm1.Output = "A"
FL = 1
End Sub
Private Sub Command4_Click()
MSComm1.Output = "E"
FL = 2
End Sub
Private Sub Command5_Click()
MSComm1.Output = "F"
End Sub
Private Sub Command6_Click()
MSComm1.Output = "E"
End Sub
Private Sub Command7_Click()
Winsock1.Connect
End Sub
Private Sub Command8_Click()
Winsock1.SendData "AA"
End Sub
Private Sub Command9_Click()
Winsock1.SendData "CC"
End Sub
Private Sub Form_Load()
Picture1.Scale (0, 260)-(1000, 0)
Picture2.Scale (0, 260)-(1000, 0)
End Sub
Private Sub Timer1_Timer()
On Error Resume Next
a = MSComm1.Input
If a <> "" Then
Text1 = a
Text9 = a
End If
For I = 1 To 20
If Mid$(Text1.Text, I, 1) = "A" Then
Text5.Text = Val(Mid$(Text1.Text, I + 1, 3))
End If
If Mid$(Text1.Text, I, 1) = "B" Then
Text4.Text = Val(Mid$(Text1.Text, I + 1, 3))
End If
If Mid$(Text1.Text, I, 1) = "C" Then
Text2.Text = Val(Mid$(Text1.Text, I + 1, 3))
End If
If Mid$(Text1.Text, I, 1) = "D" Then
Text6.Text = Val(Mid$(Text1.Text, I + 1, 3))
End If
Text3 = 100 / (Val(Text5) + 1) / (Val(Text4) + 1) / (Val(Text2) + 1)
Next I
End Sub
Private Sub Timer3_Timer()
a1 = Val(Text5.Text)
Picture1.Line (x1, a1)-(x1 + 1, a2)
a2 = a1
b1 = Val(Text4.Text)
Picture2.Line (x1, b1)-(x1 + 1, b2)
b2 = b1
c2 = c1
d2 = d1
x1 = x1 + 1
If x1 > 1000 Then
Picture1.Cls
Picture2.Cls
x1 = 0
End If
End Sub
Private Sub Timer4_Timer()
WebBrowser1.Navigate ("http://hadronsoft.com/project16/data1log.php?A=" + Text5 + "&B=" + Text4 + "&C=" + Text2 + "&D=" + Text6)
End Sub
Private Sub Timer7_Timer()
On Error Resume Next
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
Winsock1.GetData strData, vbString
a = strData
If a <> "" Then
Text1 = a
Text9 = a
End If
For I = 1 To 20
If Mid$(Text1.Text, I, 1) = "A" Then
If Mid$(Text1, I + 4, 1) = "B" Then
Text5.Text = Val(Mid$(Text1.Text, I + 1, 3))
End If
End If
If Mid$(Text1.Text, I, 1) = "B" Then
If Mid$(Text1, I + 4, 1) = "C" Then
Text4.Text = Val(Mid$(Text1.Text, I + 1, 3))
If Val(Text5) > 40 Then
Winsock1.SendData "CC"
Else
Winsock1.SendData "DD"
End If
End If
End If
If Mid$(Text1.Text, I, 1) = "C" Then
If Mid$(Text1, I + 4, 1) = "D" Then
Text2.Text = Val(Mid$(Text1.Text, I + 1, 3))
End If
End If
Next I
End Sub
What I have tried:
I have checked for solutions but i am not clear.