Visual Basic and mbed

09 Nov 2010

Hey guys,i just started working with mbed.

I need to make a porject that will need VB+mbed.

As start i want to learn how to make single things,like if i press a button on VB, to send info to mbed and turn on a simple led in port 21(for example).

Can u giveme some tips of code i will need to use?

Thx for help

09 Nov 2010

Welcome Chaud,

You should probably start here: http://mbed.org/cookbook/Interfacing-Using-RPC

Dan

09 Nov 2010

thx, i see there a lot of stuff

11 Nov 2010

i do see any info about this.

 

How i code in c to receive information by VB button? With usb connection

12 Nov 2010

You basically send strings to the mbed to control the peripherals via the RPC interface. So I guess on the button press event, send the appropriate string to the mbed serial port.

12 Nov 2010

Also an example in this thread:

12 Nov 2010

im talking about Mbed code (c code), how is called USB port? like if i send a simple integer like number 1, how i code in c for mbed to receive that number?

12 Nov 2010

Install Windows driver for mbed's USB based virtual COM port. In C or VB, it looks like a COM port.

13 Nov 2010

Hey guys, frist of all thx for all replys, but i think you guys dont see what im asking.

I need to code two things, VB and C(for mbed).

If i got a interface on VB with Button1, and pressing this button i want p21 = 1 on mbed(example).

The questions are:

1-How i code in C for mbed, to receive that information?

 

Example: with microcontroller 8051, to communicate with pc via parallel- port, i use code like this:

void writeString(char msg[]){

j=0;

while(msg[j] != '\0'){

SBUF=msg[j];

While(TI==0){}

TI=0;

j++;

}

 

Where i use two variables: TI to know when something is transmited, and SBUF that saves all transmited/Received information.

How is called mbed USB variables?

 

2-In VB how i code to send that information? with SerialPort object?

20 Nov 2010

Hi Chaud,

Just a rough idea. First of all I presume that it will not be time-critical.

You can use on the mbed 2 integers, one that represent inputs and one that represents outputs. In the main.ccp you can decide which pins (or LEDS) are using which inputs and outputs.

In the VB program you can use the same integers that represent VB buttons (outputs) and indicators.

Then set up the mbed to synchronize the output integer with the VB program and the VB program to synchronize the input integer with the mbed, for instance with the USB serial interface.

Do this every 100 msec (wait 0.1). This is why I mentioned that it is not time-critical.

In this way you can use multiple inputs and outputs.

Is this any help?

20 Nov 2010

Just found this:

 

http://mbed.org/cookbook/DotNET

 

I believe this is what you are looking for.