I'm currently working on a Visual Basic interface with my arduino. Using SerialCommunication, I'm transmiting number to the arduino from the computer to command the arduino. Really simple when it's come to command Digital output.
But where I've some problems is when I want my computer know when A voltage is apply on the Pin 2 of my arduino. Actually, when I'm applying the voltage on Pin2 my arduino send, one time only, the number "51" in com port. When I disconnect the voltage, my arduino send "50" in the com port.
With this, I want my Visual Basic software write "On" when he got the "51" and "Off" when he receive "50".
I've put a Timer in my software to read the com port at every milli-seconds with the command "s.readLine". But when I activate this timer, my software get stuck in this operation. He can't do anything else.
here is my timer code (my variable is COR) :
COR = s.ReadLine If COR = 51 Then Label1.Text = "On" Else If COR = 50 Then Label1.Text = "Off" End If
Is there any way to program my software to not getting stuck in the operation ?
I hope you understand what I mean. If you won't, don't be shy to ask me for more details ^^ Thanks in advance!