Hi, if you are sending two strings give each string a header followed by a comma like this for example
int percentageHumididy1;
int percentageHumididy2;
void setup()
{
Serial.begin(9600);
}
void loop()
{
percentageHumididy1=55;
percentageHumididy2=72;
delay(1000);
Serial.print("Sensor1,");
Serial.println(percentageHumididy1);
Serial.print("Sensor2,");
Serial.println(percentageHumididy2);
}
The commas at the end of Sensor1 and at the end of Sensor2 separate the headers from the data and by using println you would be appending a carriage return to your data. The VB serial port has a method called "ReadLine" that will read the serial buffer until it reaches a line terminator, which will be carriage return. Here is your code modified slightly to include "ReadLine" and also the split function that wildbill mentioned.
The VB form has 2 textboxes and 1 serial port
Private Delegate Sub myDelegate(ByVal Buffer As String)
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
SerialPort1.Open()
End Sub
Private Sub SerialPort1_DataReceived(sender As Object, e As SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived
SerialPort1.ReadTimeout = 100
Dim sData As String = Nothing
Try
sData = SerialPort1.ReadLine
Catch ex As Exception
End Try
Me.BeginInvoke((New myDelegate(AddressOf DisplayData)), sData)
End Sub
Private Sub DisplayData(ByVal sdata As String)
Dim txtarray As String() = Split(sdata, ",")
If txtarray.Count = 2 Then
If txtarray(0) = "Sensor1" Then
TextBox1.Text = "Sensor 1 value=" & txtarray(1) & " %"
End If
If txtarray(0) = "Sensor2" Then
TextBox2.Text = "Sensor 2 value=" & txtarray(1) & " %"
End If
End If
End Sub
The above is very basic but provides a good foundation to build on, once you capture the readings in the textboxes you can move on to add a graphical dial (a user control) that displays percentage.