MATLab Mbed

12 Aug 2011

Hi

I got this code to check whether i'm getting response from mBed using MATLAB but it seems i got a bug.

It says

??? Error using ==> SerialRPC>SerialRPC.SerialRPC at 92 No response from mbed - check it is plugged in and you are using the correct serial port

Error in ==> mbedLEDTest at 3 mybed = SerialRPC('COM3',9600);

Here's the piece code I have done.

import mbed.*

mbed = SerialRPC('COM3',9600);
myled = DigitalOut(mbed,LED1);
for i =1:1:10
myled.write(1);
pause(2);
myled.write(0);
pause(0.5);

end;
mybed.delete;
clear;

18 Jun 2012

I have the same problem. Any ideas?

I'm trying to use the MATLAB RPC. I already changed COM5 to something more sensible (OS X).

17 Jul 2012

I don't have the controller at hand so cannot test your code but:

1) Right away I see that you violate the recommendation of mbed to not give the object the name "mbed":

Quote:

To avoid a clash with the namespace name it is recommended that you do not use "mbed" as a variable/object name.

Call it "mymbed" instead.

2) Also try resetting the controller (with a button).

27 Nov 2012

I tried above code on windows xp it didnt worked. I tried it on Win 7 it worked. Also try to run it on Matlab 2009 or later. It is not compatible with earlier versions. <code> import mbed.* mymbed = SerialRPC('COM5', 9600) myled = DigitalOut(mymbed, LED1); for i = 1:1:10 myled.write(1); pause(0.5); myled.write(0); pause(0.5); end mymbed.delete; clear; <code/>