Ciao,
questo è il codice che utilizzo in VB2008 per leggere i segnali di arduino, direi che per il VB2010 dovrebbe essere la stessa cosa.
Chiaramente occorre inserire il componente "SerialPort".
Private Sub InitPortComunication()
With SerialPort1
.BaudRate = 9600
.PortName = "COM5"
.Parity = IO.Ports.Parity.None
.DataBits = 8
.StopBits = IO.Ports.StopBits.One
'.ReceivedBytesThreshold = 4
End With
SerialPort1.Open()
SerialPort1.DiscardInBuffer()
End Sub
Private Sub mySerialPort_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived
Dim riga As String
riga = SerialPort1.ReadLine
End Sub
Un saluto,
Tredipunta.