Hi cncmachineguy;
To receive data from the serial port you should always use SerialPort Event Trigger like the one i posted.
Code:
Private Sub DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived
Dim recepcao As String
recepcao = SerialPort1.ReadExisting
If recepcao = "%TE" Then
GetCursorPos(rect)
SetCursorPos(rect.X - 1, rect.Y)
End IF
End Sub
Don't use timers to poll the serial port, it is not very efficient!!
If you want to send data to PIC, like a press of a button, then you can use the timer. just put the code that you have inside the button, inside of the timer, and choose the interval!
I wrote this post in a little hurry, later i have more time and i came back here!
Bookmarks