DotNET

mbed .NET RPC Library

Here you can find a library for interfacing .NET programs with mbed using RPC.

This could be used for:

  • Controlling actuators from and reading data into .NET programs - over
  1. Serial (RS232)
  2. USB
  3. Bluetooth over serial or USB (e.g. Prolific chip)
  4. ZigBee over serial
  5. HTTP (see: .NET mbedRPC Library with HTTP support below)
  6. etc...
  • Creating a GUI for mbed programs

All this work could be done because you folks and mbed members did a great job. I just ported the Java stuff to .NET in a very easy manner. Thanks to Michael and to all others.

.NET is potentially a great choice for interfacing to mbed over a network as it can be run over Communication Foundation and across many different platforms - e.g.: .NET Micro Framework 4.1 for Visual Studio 2010 Express and all others (Appache Licence - absolutely free to use and portable to ARM controllers and others!), Compact Framework, Standard Framework .NET 4.0, ASP.NET, etc.). This page shows how to use the library to create .NET applications using serial and (later) over HTTP. HTTP is not implemented till now in this BETA, but will be soon.

Information

To use the mbedRPC library your mbed needs to be running code which can receive and execute RPC commands. Information and examples of this, can be found on the Interfacing-Using-RPC page. Compile and run the program for the type of transport mechanism you wish to use.

The .NET mbedRPC Serial Library

Here is the mbedRPC .NET library as a Visual Studio 2010 Project zip file: mbedRPC.zip - (no HTTP support - only serial/HTTP support see article below...)

And here an example of how to use the .NET mbed library and some simple code required to get started and flash LED1 and LED2 - like Michaels Java sample. This will run as a .NET Windows application.

mbedRPC_HelloWorld_DotNET

using System;
using System.Windows.Forms;
using System.Diagnostics;
using System.Threading;
using org.mbed.RPC;

namespace mbedRPC.Test
{
    public partial class mbedRCPTest : Form
    {
        DigitalOut led1;        // mbed DigitalOut RPC declaration -> LED1
        DigitalOut led2;        // mbed DigitalOut RPC declaration -> LED2
        mbed mbed;              // the embed itself

        public mbedRCPTest()
        {
            InitializeComponent();
        }

        private void mbedRCPTest_Load(object sender, EventArgs e)
        {
            Debug.Print("mbed RPC Hello World");

		    //Create an mbed object for communication over USB (serial)
		    mbed = new SerialRxTxRPC("COM10", 9600);
            //Or over serial: mbed = new SerialRPC("COM10", 9600);
		    //Or later:   mbed = new HTTPRPC("http://192.168.2.2")
		
		    //Create new Digital Outputs on the mbed
		    led1 = new DigitalOut(mbed, mbed.LED1);
		    led2 = new DigitalOut(mbed, mbed.LED2);
        }

        private void flash(int n)
        {
            try
            {
                for (int i = 0; i < n; i++)
                {
                    //Call the DigitalOut objects' methods 
                    led1.write(1);          // on
                    led2.write(0);          // off
                    Thread.Sleep(250);      
                    led1.write(0);          // off
                    led2.write(1);          // on
                    Thread.Sleep(250);
                }
                led2.write(0);        // reset last state - all leds are off now
            }
            catch (NullReferenceException ex)
            {
                Debug.Print("No Reference: " + ex.Message);
            }
        }

        private void btnFlash_Click(object sender, EventArgs e)
        {
            btnFlash.Enabled = false;
            btnExit.Enabled = false;
            btnFlash.Text = "Is Flashing";
            flash(10);
            btnFlash.Text = "Start Flash";
            btnExit.Enabled = true;
            btnFlash.Enabled = true;
        }

        private void btnExit_Click(object sender, EventArgs e)
        {
            try
            {
                mbed.delete();
                Debug.Print("Complete");
            }
            catch (NullReferenceException ex)
            {
               Debug.Print("No Reference: " + ex.Message);
            }
            this.Close();
        }
    }
}

Quote:

And here the corresponding UI

/media/uploads/Stanislaus/ui.gif

mbedRPC_HelloWorld_DotNET (mbedrpc.test.zip)

Information

If you want to make an RPC call which isn't wrapped by the classes we have provided then use:

String RPCresponse = mbed.RPC(<String ObjectName>,<String MethodName>,<String[] Arguments>);

The .NET mbedRPC Library with HTTP support

Sorry for not updating the HTTP stuff for such a long time. I was very busy at my job and without time to do this. Thanks a lot for waking me up - Tom - and thanks for your code. I'll post my code now, too. So you can decide which one to use. The mebd community is great and producing a lot of code we all can share. :)

Information

As mentioned above - to use the mbedRPC library your mbed needs to be running code which can receive and execute RPC commands. Information and examples of this, can be found on the Interfacing-Using-RPC page. Compile and run the program for the type of transport mechanism you wish to use.

Short description how to use the code

After compiling the RPC library (Interfacing-Using-RPC) for mbed and downloading the code onto mbed you first of all have to start a terminal programme with mbed standard debugging settings (9600, 8, N, 1). Than reset your mbed and you will see this:

/media/uploads/Stanislaus/teraterm.gif

After round about 5 seconds you'll see an IP address the router has assigned to the mbed. This IP has to be used in the sample code and mbed is doing this over DHCP automatically for you.

using System;
using System.Windows.Forms;
using System.Diagnostics;
using System.Threading;
using org.mbed.RPC;

namespace mbedRPC.Test
{
    public partial class mbedRCPTest : Form
    {
        // the mebed RPC methods
        private DigitalOut  led1;           // mbed DigitalOut RPC declaration -> LED1
        private DigitalOut led2;            // mbed DigitalOut RPC declaration -> LED2
        private DigitalOut led3;            // mbed DigitalOut RPC declaration -> LED1
        private DigitalOut led4;            // mbed DigitalOut RPC declaration -> LED2
        private AnalogOut analogOut;
        private AnalogIn analogIn;
        private PwmOut pwmOut;

        // the mbed objects 
        private HTTPRPC mbedHTTP;
        private mbed mbed;                  // the embed itself

        public mbedRCPTest()
        {
            InitializeComponent();
        }

        private void btnExit_Click(object sender, EventArgs e)
        {
            try
            {
                mbed.delete();
                Debug.Print("Complete");
            }
            catch (NullReferenceException ex)
            {
               Debug.Print("No Reference: " + ex.Message);
            }
            this.Close();
        }

        private void mbedRCPTest_Load(object sender, EventArgs e)
        {
            // !!!!!ATTENTION!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            // Set your mbed WEB Server address here!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            // This is the address you'll get back in your terminal programme !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            String myMBEDAddress = "http://192.168.2.108";      // this is the address the router gave me back
            Debug.Print("mbed RPC Hello World");

            // but test if reachable first
            mbedHTTP = new HTTPRPC(myMBEDAddress);

            if (mbedHTTP.IsAlive == false)
            {
                // not reachable -> wrong ip address or not connected, etc.
                labelAnswer.Text = mbedHTTP.StatusMessage;
            }
            else
            {
                labelAnswer.Text = mbedHTTP.StatusMessage;

                //both ways are possible
                //Decide with is okay for you
                mbed = mbedHTTP.MBED;                       // I prefer this one!
                //or:
                //mbed = new HTTPRPC(myMBEDAddress);        
            }

            try
            {
                //declare in/outputs on the mbed
                led1 = new DigitalOut(mbed, mbed.LED1);
                led2 = new DigitalOut(mbed, mbed.LED2);
                led3 = new DigitalOut(mbed, mbed.LED3);
                led4 = new DigitalOut(mbed, mbed.LED4);
                analogOut = new AnalogOut(mbed, mbed.p18);
                analogIn = new AnalogIn(mbed, mbed.p19);
                pwmOut = new PwmOut(mbed, mbed.LED4);
            }
            catch (NullReferenceException ex)
            {
                Debug.Print("No Reference at loading test: " + ex.Message);
            }
            catch (Exception ex)
            {
                //something went wrong
                Debug.Print("Error at loading test: " + ex.Message);
            }
        }

        private void flash(int n)
        {
            try
            {
                for (int i = 0; i < n; i++)
                {
                    //Call the DigitalOut objects' methods 
                    led2.write(1);          // on
                    led3.write(0);          // off
                    Thread.Sleep(250);      
                    led2.write(0);          // off
                    led3.write(1);          // on
                    Thread.Sleep(250);
                }
                led3.write(0);
                led2.write(0);        // reset last state - all leds are off now
            }
            catch (NullReferenceException ex)
            {
                Debug.Print("No Reference: " + ex.Message);
            }
        }

        private void btnFlash_Click(object sender, EventArgs e)
        {
            btnFlash.Enabled = false;
            btnExit.Enabled = false;
            btnFlash.Text = "Is Flashing";
            flash(5);
            btnFlash.Text = "Flashing LED2+3";
            btnExit.Enabled = true;
            btnFlash.Enabled = true;
        }

        private void checkBoxLED1_CheckedChanged(object sender, EventArgs e)
        {
            if(led1 == null) return;

            if (checkBoxLED1.CheckState == CheckState.Checked)
                led1.write(1);
            else
                led1.write(0);
        }

        private void checkBoxLED2_CheckedChanged(object sender, EventArgs e)
        {
            if (led2 == null) return;

            if (checkBoxLED2.CheckState == CheckState.Checked)
                led2.write(1);
            else
                led2.write(0);
        }

        private void checkBoxLED3_CheckedChanged(object sender, EventArgs e)
        {
            if (led3 == null) return;

            if (checkBoxLED3.CheckState == CheckState.Checked)
                led3.write(1);
            else
                led3.write(0);
        }

        private void btnAnalog_Click(object sender, EventArgs e)
        {
            analogOut.write(0.75f);
            double outVal = analogOut.read();
            double inVal = analogIn.read();
        }

        private void trackBarAnalogOut_ValueChanged(object sender, EventArgs e)
        {
            float val = trackBarAnalogOut.Value;
            float valOut = val / 10.0f;
            analogOut.write(valOut);

            double inVal = analogIn.read() * 3.3f;
            textBoxVoltage.Text = String.Format("{0:0.000}", Math.Round(inVal, 3));
        }

        private void btnPWM_Click(object sender, EventArgs e)
        {
            try
            {
                for (float p = 0.0f; p < 0.6f; p += 0.1f)
                {
                    pwmOut.write(p);
                }
                for (float p = 0.7f; p >= 0.0f; p -= 0.1f)
                {
                    pwmOut.write(p);
                }
                pwmOut.write(0.0f);
            }
            catch (NullReferenceException ex)
            {
                Debug.Print("No Reference: " + ex.Message);
            }
        }

        private void timerRPC_Tick(object sender, EventArgs e)
        {
            if (mbedHTTP != null)
            {
                if (mbedHTTP.IsAlive)
                {
                    btnReset.Enabled = false;
                    labelAnswer.Text = mbedHTTP.StatusMessage;
                }
                else
                {
                    btnReset.Enabled = true;
                    labelAnswer.Text = mbedHTTP.StatusMessage;
                }
            }
        }

        private void btnReset_Click(object sender, EventArgs e)
        {
            //check connection, router or cable
            //reset the flag and try again
            mbedHTTP.IsAlive = true;
        }
    }
}

See the exclamation marks in the source code above in the mbedRCPTest_Load function. Here you have to fill in the IP you get back from the router - visible in the terminal window. After doing so you have to recompile or to start your test project. If everything went well you'll see this window:

/media/uploads/Stanislaus/testgui.gif

If you see success (encirceled) in the dialog box, everything went well and you can use RPC over HTTP. If you don't have access to the mbed the Reset button is enabled and you can try to connect again after you have fixed your problem by ticking Reset button. If the problem is fixed success will be shown and the Reset button is disabled.

Here you can find the mbedRPC .NET library as a Visual Studio 2010 Project zip file: mbedRPCWithHTTP.zip

In the zip file you will find 2 paths:

  • mbedRPC -> the library with HTTP support now.
  • mbedRPC.Test -> the test programme with the common solution file.

Open the solution and both projects will be opened together and you can set the Test project as default and start it. But adapt the IP first!

More to improve in the future

The Library is synchronous for the moment - means the (.NET) client software has to wait for the mbed till it ends with the execution. Asynchronous methods should improve this. So the client software need not to wait till the mbed exectued the RPC commands. This is a fire and forget mechanism. The response is send than - after the mbed execution - in an event and should make the client software more fluent.

HTTPS is an issue, too. I have written the Library code to deal with credentials, but I never tested it. Plenty of things still to do. :)

Thanks to all and for your great support.





44 comments:

14 Oct 2010

Good news.

I use .net to talk to all my projects but havent had time to sit down and make a nice friendly wrapper.

Let me know if you need a hand. Especially with the direct serial communications (I had some trouble with read() and readexisting() but created an internal buffer to sort it all out)

14 Oct 2010

Hi Daniel!

Wow! Cool! Quick response to this - for the moment very short - article. :-) Yes, of course. Help is usefull. I only wrapped the things Michael wrote for Java and havn't had the time to test all the stuff in deep. The first things are working (DigitalOut). Help for direct serial communication will be great, really. I have only an embed - no expansion boards. That's the reason HTTP isn't implemented yet. The project is available as zip file now (see article). I have compiled it with Visual Studio 2010 - but hopefully it's working with Express, too. A short sample how to use the stuff I'll post soon, too.

Great. :-)

Regards StanDeMan

11 Nov 2010

To bad : with SharpDevelop 3.2 I can't get it to run...

14 Nov 2010

Thanks Stanislaus, your cookbook article has been of great help to me :-)

Here's my solution for automatically finding the mbed's COM port number so it doesn't have to be found by trial and error and then set forever in software, something that had been given me a headache because they keep choosing different COM port numbers! Full post is here: http://forum.ecuproject.com/viewtopic.php?f=51&t=2957&start=60#p34681

http://forum.ecuproject.com/viewtopic.php? wrote:

I had noticed that my mbed/Just4Trionic has different COM numbers on my laptop and a friends PC :!: So, a method of working out what how the COM number is determined was needed :o :roll: :?: :?: :?: . This simple task is made possible by some impossible software trickery :o and means I am at last on my way with my own C# Just4Trionic.dll for T5suiteII 8-)

Here's the code the finds the mbed COM number:

code-snippet_for_finding_mbed's_COM_number

            /// <summary>
            /// Recursively enumerates registry subkeys starting with strStartKey looking for
            /// "Device Parameters" subkey. If key is present, friendly port name is extracted.
            /// </summary>
            /// <returns string> null if no mbeds found, "COMx" if an mbed is found (where x is a number, e.g "COM3")
            /// <param name="strStartKey">the start key from which to begin the enumeration</param>
            private string MineRegistryForJust4TrionicPortName(string strStartKey)
            {
                // ...GetPortNames obtains a list of COM ports that are actually connected. Without using this
                // list the code will still try to connect to an mbed even if it isn't connected because the registry
                // seems to remember things even if they are unplugged
                string[] oPortNamesToMatch = System.IO.Ports.SerialPort.GetPortNames();
                Microsoft.Win32.RegistryKey oCurrentKey = Registry.LocalMachine.OpenSubKey(strStartKey);
                string[] oSubKeyNames = oCurrentKey.GetSubKeyNames();
                if (oSubKeyNames.Contains("Device Parameters"))
                {
                    object oPortNameValue = Registry.GetValue("HKEY_LOCAL_MACHINE\\" + strStartKey + "\\Device Parameters", "PortName", null);
                    return oPortNamesToMatch.Contains(oPortNameValue.ToString()) ? oPortNameValue.ToString() : null;
                }
                else
                {
                    foreach (string strSubKey in oSubKeyNames)
                        if (MineRegistryForJust4TrionicPortName(strStartKey + "\\" + strSubKey) != null)
                            return MineRegistryForJust4TrionicPortName(strStartKey + "\\" + strSubKey);
                }
                return null;
            }

14 Nov 2010

Haha, apparently I write too much for everything to fit in one post (it's a good jump they don't restrict me at forum.ecuproject.com :lol:) Here's the rest of my post:

Quote:

And this is how it is used to open the COM port for the mbed/Just4Trionic:

code-snippet_for_using_mbed's_COM_number

              //Create an mbed object for communication over USB (serial)
                string port = MineRegistryForJust4TrionicPortName("SYSTEM\\CurrentControlSet\\Enum\\USB\\VID_0D28&PID_0204&MI_01");
                if (port == null)
                {
                    MessageBox.Show("Oh dear :-( Just4Trionic\r\nDoesn't seem to be connected");
                    this.Close();
                }
                MessageBox.Show(string.Format("Just4Trionic is connected to ({0})", port));
                mbed = new SerialRxTxRPC(port, 9600);

Courtesy of some very clever chap at Creative Code Design (I've distilled his example to look only for an mbed): http://creativecodedesign.com/node/39 and the .NET cookbook article at mbed.org: http://mbed.org/cookbook/DotNET Thanks too to johnc who told me about VID and PID, armed with this information and a google guide to using 'regedit' I found out where the Creative Code needed to look (Actually the Creative Code example can find the mbed starting from "SYSTEM
CurrentControlSet
Enum" and checking for a FriendlyName that includes "mbed", but this takes longer, and since I know I'm looking for an mbed why not cut corners :roll: ).

I hope this helps someone else :-) Sophie x

14 Nov 2010

user Sven H. wrote:

To bad : with SharpDevelop 3.2 I can't get it to run...

What errors did you get? Did it comile? I used Studio 2010 and .NET 4.0. Never tested it with SharpDevelop. Cheers! Stanislaus

14 Nov 2010

user Stanislaus Eichstaedt wrote:

user Sven H. wrote:

To bad : with SharpDevelop 3.2 I can't get it to run...

What errors did you get? Did it compile? I used Studio 2010 and .NET 4.0. Never tested it with SharpDevelop. Cheers! Stanislaus

14 Nov 2010

Hi all, is anyone working on HTTP? I have started to write it but if someone has a finished solution - let us know, please. I never have tested the Lib with nativ RS232 - only over USB. Experience or help is welcome. Regards Stanislaus

14 Nov 2010

user Sophie Dexter wrote:

Haha, apparently I write too much for everything to fit in one post (it's a good jump they don't restrict me at forum.ecuproject.com :lol:) Here's the rest of my post:

Quote:

And this is how it is used to open the COM port for the mbed/Just4Trionic:

code-snippet_for_using_mbed's_COM_number

              //Create an mbed object for communication over USB (serial)
                string port = MineRegistryForJust4TrionicPortName("SYSTEM\\CurrentControlSet\\Enum\\USB\\VID_0D28&PID_0204&MI_01");
                if (port == null)
                {
                    MessageBox.Show("Oh dear :-( Just4Trionic\r\nDoesn't seem to be connected");
                    this.Close();
                }
                MessageBox.Show(string.Format("Just4Trionic is connected to ({0})", port));
                mbed = new SerialRxTxRPC(port, 9600);

Courtesy of some very clever chap at Creative Code Design (I've distilled his example to look only for an mbed): http://creativecodedesign.com/node/39 and the .NET cookbook article at mbed.org: http://mbed.org/cookbook/DotNET Thanks too to johnc who told me about VID and PID, armed with this information and a google guide to using 'regedit' I found out where the Creative Code needed to look (Actually the Creative Code example can find the mbed starting from "SYSTEM
CurrentControlSet
Enum" and checking for a FriendlyName that includes "mbed", but this takes longer, and since I know I'm looking for an mbed why not cut corners :roll: ).

I hope this helps someone else :-) Sophie x

Cool. :) Everything is helpful. Thanks Sophie. I'm glad the article has helped you. Cheers! Stanislaus

15 Nov 2010

Quote:

To bad : with SharpDevelop 3.2 I can't get it to run...

Quote:

What errors did you get? Did it comile? I used Studio 2010 and .NET 4.0. Never tested it with SharpDevelop. Cheers! Stanislaus

1st problem : SharpDevelop Version 3.2 could not read the Studio Version 11 project. After making my own new project and copy & paste the code, the example runs, but the dll failed.

2nd problem : I had to do the same with the dll (make my own project and copy & paste all the code) the *.cs files where ok.

Now it works - but slow (as written in the forum) I 'calculated' a frequency of app 50 Hz with follwing assumptions : (9600 bps divided by 8 = 1000 bytes per second, divided by app 10 bytes per command = 100 Hz, divided by two states = 50 Hz). Probably my assumptions are far away from the real ;-(

15 Nov 2010

@ Sven H. Thanks for response and for using the Lib. Okay, it's working now - but slow. I will take a look what's the problem here. Maybe I can fix something. I'm working on HTTP, too. Hopefully coming soon. :) Bests! Stanislaus

15 Nov 2010

@all: HTTP is working now. I'm testing it right now and will post the extended sources soon. Thanks for the very kind help from Japan - Shinishiro Nakamura. With star board orange I could complete the HTTP class now.

15 Dec 2010

In a learning project I am trying to control my mbed usng RPC, in particular over the USB connection with the code on the PC based on the blink example above. I am however new to C# and have a problem with using variables over RPC.

On my mbed I have the following code snippet which complies but has not been tested yet.

int m(0) ; RPCVariable<int> rpc_m(&m,"m");

On the PC I have the blink program working but cannot make it complile to acept the code that tells RPC about the variable m on the embed

I have added two lines of code

public partial class mbedRCPTest : Form { DigitalOut led1; mbed DigitalOut RPC declaration -> LED1 DigitalOut led2; mbed DigitalOut RPC declaration -> LED2 mbed mbed; the embed itself int M; my new line of code

and

led2 = new DigitalOut(mbed, mbed.LED2); M = new RPCVariable<int>(mbed, mbed.m); new line that fails to compile

I assume I need some definition of m that is analagous to the lines

public static PinName LED1 = new PinName("LED1");

However I just cannot workout the format or the location.

I suspect the answer is trivial and I do aplogise for such a simple question but any help will be much appreciated.

Allan

15 Dec 2010

I have foubd my silly mistake and it is now working.

28 Dec 2010

Lol :)

27 Mar 2011

if i use .Net interface above, may i know what is the code should be store in Mbed controller? I means cpp file.Thanks

07 Apr 2011

And the same code for Visual Basic 2010 dotnet 4

Form name=form1

2 buttons:

button 1 = btnFlash

button 2 = btnExit

Download the c# example and extract the dll. Add a reference to the dll from the c# example

Code:

Imports System

Imports System.Windows.Forms

Imports System.Diagnostics

Imports System.Threading

Imports org.mbed.RPC

Public Class Form1

Dim led1 As DigitalOut

Dim led2 As DigitalOut

Dim led3 As DigitalOut

Dim led4 As DigitalOut

Dim mbed As mbed

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Debug.Print("mbed RPC Hello World")

'Create an mbed object for communication over USB (serial)

mbed = New SerialRxTxRPC("COM5", 9600)

'Or over serial: mbed = new SerialRPC("COM10", 9600);

'Or later: mbed = new HTTPRPC("http://192.168.2.2")

'Create new Digital Outputs on the mbed

led1 = New DigitalOut(mbed, mbed.LED1)

led2 = New DigitalOut(mbed, mbed.LED2)

led3 = New DigitalOut(mbed, mbed.LED3)

led4 = New DigitalOut(mbed, mbed.LED4)

led1.write(0)

led2.write(0)

led3.write(0)

led4.write(0)

Debug.Print("end of load")

End Sub

Private Sub flash(ByVal n As Integer)

Try

For i As Integer = 0 To n - 1

'Call the DigitalOut objects' methods

led1.write(1)

' on

led2.write(0)

' off

Thread.Sleep(250)

led1.write(0)

' off

led2.write(1)

' on

Thread.Sleep(250)

Next

' reset last state - all leds are off now

led2.write(0)

Catch ex As NullReferenceException

Debug.Print("No Reference: " & ex.Message)

End Try

End Sub

Private Sub btnFlash_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFlash.Click

Debug.Print("btnFlash clicked")

btnFlash.Enabled = False

btnExit.Enabled = False

btnFlash.Text = "Is Flashing"

flash(10)

btnFlash.Text = "Start Flash"

btnExit.Enabled = True

btnFlash.Enabled = True

End Sub

Private Sub btnExit_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click

Debug.Print("btnExit clicked")

Try

mbed.delete()

Debug.Print("Complete")

Catch ex As NullReferenceException

Debug.Print("No Reference: " & ex.Message)

End Try

Me.Close()

End Sub

End Class

The only drawback is the speed of the serial connection (9600 bd).

How easy is it to set it to a higher speed?

Sorry for the messy list.

08 Apr 2011

WIth above .net source code. What is the C code(.cpp format) should i write in the Mbed controller to communicate between Mbed and PC app(VB.net)?

Thanks

08 Apr 2011

Hi Charles

Example code to run on mbed to use with the above can be found on the Interfacing Using RPC page. This code will work with the above library in .net Theres an example for control over HTTP or over serial

08 Apr 2011

Can someone please post a complete example including the C# and the mBed code? I'm having trouble getting it to work. Thanks