Here is a pretty simple one. When you push the button the input from the Arduino shows up in the immediate window. just make a form with a button
Public Class Form1
Public readstr As String
Function getCom() As String
readstr = ""
If SerialPort1.IsOpen = True Then
SerialPort1.Close()
SerialPort1.Open()
readstr = SerialPort1.ReadLine
Debug.Print(readstr)
getCom = readstr
End If
End Function
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
SerialPort1.BaudRate = 9600
SerialPort1.Parity = 0
SerialPort1.StopBits = IO.Ports.StopBits.One
SerialPort1.DataBits = 8
SerialPort1.PortName = "com7"
SerialPort1.Open()
End Sub
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
dim bob as string
bob = Me.getCom()
Debug.Print(bob)
'put your code to translate to an integer here
End Sub
End Class