Hello all i am trying to interface my arduino project with visual basic via serial communication. I have gotten my visual basic program to write to my ardunio successfully. However, i want to allow my visual basic program to read the incoming serial data from the arduino this i am having problems on. I have searched the internet for about 5 days looking for a solution or good tutorial to visual basic and serial communication but have been unfortunately unable to find anything good.
My visual basic code
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If Arduino.IsOpen Then Dim bob As String = Arduino.ReadLine() If bob = 9 Then maintankhigh.Visible = False Else Arduino.Open() End If End If End Sub Private Sub Feed_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Feed.Click If Arduino.IsOpen Then
Arduino.Write(7) End If End Sub //other unrelated code does here End Class
My arduino is currently setup to send a one digit number like "3" when a switch is activated aka put in the closed position
Thank You for your help