How to save a m-file on the lego ev3 brick?

4 次查看(过去 30 天)
Hello, I need to know how i can save an matlab m-file on a lego ev3 brick using an usb-connection. I didn't found anything on google. I would like to select the saved program on the brick and run it with the buttons. But how to get it there? At the moment i am just able to run the programm while the brick ist connected with the usb-cable. please help me :) Thanks

回答(1 个)

Walter Roberson
Walter Roberson 2015-11-13
You could possibly transfer the source to the ev3, but none of that series can execute MATLAB m files. The process of using an ev3 involves generating code that the ev3 can use, and that code is not m files at all.
  2 个评论
Philipp Rau
Philipp Rau 2015-11-13
so then please tell me HOW can i program in matlab (not simulink) and then transfer to the ev3? I havn't even a clue how to access the ev3 for saving a file. I just can run my m-file while connected, and thats really not useful.
Walter Roberson
Walter Roberson 2015-11-19
Looking around a bit, it appears that you can ssh to the ev3. It appears to require the username root and the password is empty (not the word "empty", just press return at the password prompt). If this is the case then you can also scp() files on to the EV3 and then ssh in and start them executing.
The EV3 can be programmed in a number of different programming languages. I do not know which one Simulink uses, but it probably uses C or C++ together with a cross-compiler for the ARM processor.
If you want to convert MATLAB code into something that would run on the EV3, the simplest way would be to include it in a MATLAB Function Block in Simulink and use Simulink to generate and run the model. But otherwise you are going to need to use MATLAB Coder and a cross-compiler. MATLAB Coder is not available for Student Version licenses.
There might be some other method that I have missed.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 MATLAB Support Package for LEGO MINDSTORMS EV3 Hardware 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by