I want to execute couatall.text to increment but nested-if in timer ticking in every 1000 microsecond/1 second is not working. Please help me, here's my code...
I do this because my sensor read two,three times or more than that of less than 900 value in a time, which is if I only use '1-If condition' it count two,three times or more than that. so my logic(noob) is if my sensor reads less than 900 after that if my sensor reads greater than 899 it's execute 'coutall.Text = coutall.Text + 1' code to count 1 and so on.
Private Sub Timer3_Tick(sender As Object, e As EventArgs) Handles Timer3.Tick
Try
Dim i As Single = SerialPort1.ReadExisting 'get data of my sensor
label1.Text = i.ToString 'display on label1.text
If label1.Text < 900 Then
'messageBox.show("working here")
'I really make it comment lines don't mind it.
If label1.Text > 899 Then 'not working when my i is < to 900
coutall.Text = coutall.Text + 1
End If
Else
'nothing
End If
Catch ex As Exception
End Try
End Sub
let me know if my explanation is not clear, I'm not good in English sorry. :)