![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/176098/image.png)
Lego mindstorms NXT support package
조회 수: 7 (최근 30일)
이전 댓글 표시
Does the MATLAB student package come with Lego Mindstorms NXT support package? If no, how can i install it please?
댓글 수: 0
채택된 답변
Mischa Kim
2014년 10월 14일
편집: Mischa Kim
2014년 10월 14일
Nauman, in MATLAB simply go to Resources > Add-Ons > Add Hardware Support Packages, select and download the NXT package for free.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/176098/image.png)
댓글 수: 5
Mischa Kim
2014년 10월 14일
The LEGO MINDSTORMS NXT Support from Simulink is available on 32-bit and 64-bit Microsoft Windows only. See the documentation (bottom of page).
추가 답변 (1개)
Daniele
2022년 10월 14일
편집: Daniele
2022년 10월 14일
Hi Nauman
You can download the RWTHMindstormsNXT library from:
Some small tuning is necessary (at least on my PC, with Matlab 2022a installed) after having correctly paired between PC and Lego NXT, and having identified the outgoing COM port used by the SPP (in my case COM6).
I naturally installed the original software provided by Lego to check that the robot was properly connected to the PC and working.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1156708/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1156713/image.png)
Here are the changes.
1. Function “COM_OpenNXTEx.m”
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1156718/image.png)
Use the "serialport" Matlab function instead of the "serial" function that will be removed in future releases of Matlab.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1156723/image.png)
Using "serialport" the serial connection speed no longer wants the specification through the pair 'Name', 'Value', but only wants a double value (Value), the baudrate: you must therefore remove 'BaudRate' label.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1156728/image.png)
2. Function “checkHandleStruct.m”
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1156733/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1156738/image.png)
Update the type (class) of the h.Handle variable from 'serial' to 'internal. Serialport'.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1156743/image.png)
Finally disable the warnings at the beginning of each user program (script):
warning('off','all')
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1156943/image.png)
These small changes in my case worked. Finally, after countless attempts, I was able to reproduce a tone and read the battery status of my NXT from Matlab! (And also to control the engines ... ).
Bye
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 LEGO MINDSTORMS EV3 Hardware에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!