Running MBED from Visual Basic

29 Jan 2010

I just downloaded the free Visual Basic Express 2008 from Microsoft and found that the communcation control object seems to work fine with MBED.

It is nice to have a rapid PC-host dev env as well :-)

Anders

29 Jan 2010

Which Object for which interface?

They also have C# and C++, all the .NET objects work with all the languages.

I hate VB, but thats a personal preference.

29 Jan 2010

I used the SerialPort object.

I'm a Java guy but I wanted to see if VB could be used as well and it turned out fairly OK.

Anders

29 Jan 2010

Here is some VB code to control LED1 and LED2 using the HTTPServer demo and RPC.

Imports System.Net
Imports System.Web

Public Class Form1
Dim client As New WebClient
Dim query As String

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
query = "http://mbed-ip/rpc/led1/write+1"
Try
client.DownloadString(query)
Catch ex As Exception
End Try
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
query = "http://mbed-ip/rpc/led1/write+0"
Try
client.DownloadString(query)
Catch ex As Exception
End Try
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
query = "http://mbed-ip/rpc/led2/write+1"
Try
client.DownloadString(query)
Catch ex As Exception
End Try
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
query = "http://mbed-ip/rpc/led2/write+0"
Try
client.DownloadString(query)
Catch ex As Exception
End Try
End Sub
End Class

08 Apr 2011

Hi,

what code should write on the mbed controller to make it works?

10 Apr 2011

I done it.Now able to use VB.net communicate with my mbed. Thanks,TOM. I appreciated it.

Regards,

Charles