GUI to send values to Arduino?

For a project of mine I'd like to create a GUI that will allow me to input various strings and numbers that will then be sent to my Arduino Uno to be defined as various values. My Arduino program works perfectly fine but I'd like to make it more user friendly when it comes to updating or changing values that doesn't require scrolling through the bare code everytime.

Now at first I thought this would be a simple task of picking a library or interface that best suited my needs but surprisingly I haven't found one. I'd prefer something done in Visual Basic but most examples I've found only concern reading values from Arduinos instead of sending them (or they seem to be intended for far more complicated tasks all together).

In short is there some a reasonably decent looking interface out there that lets me put in a number into a text box and just send it to my Arduino? Thanks.

That is really a question for a Visual Basic Forum.



Robin2: That is really a question for a Visual Basic Forum.


Well while I'd prefer VB I'd be interested in seeing anything that does the same.

spycatcher2k: I will write one for you, or you could write one for your self. You are unlikely to find an exact program to fit your exact requirement. Sending is easier than receiving values, so you should not have any major problem.

Could you please? While I have some experience with VB having it actually send values to an Arduino is new to me and I can't quite find a simple example of doing so.

Maybe this Python GUI demo will be of interest. I use LInux but I believe the code will run on Windows if you edit the references to the serial port (its a long time since I wrote it).

When I write a GUI for myself now I create it with HTML and CSS so it is accessed in a browser. The Python Bottle web framework makes that easy. And I use the techniques in this Python - Arduino demo and in Serial Input Basics for communicating with my Arduinos.


below is the VB code for a simple terminal emulator using a Form which contains the following components 1. a SerialPort - when data arrives at the serial port the DataReceived() event handler is called which uses a Delagate to pass the text to a 2. TextBox which displays the received text - it has a KeyPress() event handler which when a key is pressed on the TextBox the character to transmitted to the SerialPort

Public Class Form1
    ' set up delegate to display data received from serial port
    Private Delegate Sub SerialDelegate(ByVal Buffer As String)
    Private adre As New SerialDelegate(AddressOf DisplayData)
    ' key pressed on terminal textbox
    Private Sub TextBox1_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
    End Sub
    ' character received from serial port
    Private Sub SerialPort1_DataReceived(ByVal sender As System.Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived
        Dim ReceivedData As String = SerialPort1.ReadExisting()
        Me.Invoke(adre, ReceivedData)
    End Sub
    ' delegate to display string received
    Private Sub DisplayData(ByVal sdata As String)
    End Sub
    ' on form load open serial port
    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
    End Sub

    Private Sub Form1_FormClosed(sender As System.Object, e As System.Windows.Forms.FormClosedEventArgs) Handles MyBase.FormClosed
    End Sub
End Class