hi people .
anyone knows how to transfer 4 different values at the same time from sensors from arduino to visual basic 6?
ex: i have 4 values from sensors
2,43 3,40 8,50 0,82 this is my sensor values from arduino analog input pins A1 A2 A3 A4
now i need to read all these values from visual basic 6 in 4 different textbox
Your PC program will see it as "<123.45,87.65> and after stripping off the start and end markers the data will be in CSV format for which there is almost certainly a ready-made parsing function.
once you have the data in CSV format as Robin suggests you can use String.Split and Integer.TryParse methods to obtain the numeric values which you can then place TextBox components, e.g.
Dim s As String = "<2.43,3.40,8.50,0.82>"
Dim words As String() = s.Split("<,>".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)
For i As Integer = 0 To words.Length - 1
Dim value As Double
If Double.TryParse(words(i), value) Then
Console.WriteLine(words(i))
Else
Console.WriteLine("Error! string '" + words(i) + "' is not a Double")
End If
Next
gives
2.43
3.40
8.50
0.82
Press any key to continue . . .
first of all thank you all for your reply
this is the code i end with
timer1_timer()
Dim aa
Dim bb
Dim cc
Dim firstData
Dim secondData
aa = Text1.Text
bb = Text1.Text
cc = Text1.Text
aa = Left$(aa, 10)
bb = Left$(bb, 20)
cc = Right(cc, 5)
firstData= Left(cc, 6)
secondData= Right(bb, 1)
Label1.Caption = firstData+ secondData
'Label2.Caption = secondData