Magnetic Sensor in LEGO MINDSTORMS NXT Support from Simulink

1 vue (au cours des 30 derniers jours)
Ola Martner
Ola Martner le 23 Mai 2012
How do I use HiTechnic NXT Magnetic Sensor <http://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action&key=NMS1035> in my Simulink model? Is it possible in the Simulink toolbox or do I need to use another programming environment to use this sensor?

Réponse acceptée

Kaustubha Govind
Kaustubha Govind le 23 Mai 2012
From what I know the Simulink Run on Target feature uses the nxtOSEK environment, which does not seem to support the HiTechnic NXT Magnetic Sensor at this point. If you are able to write C code to communicate with the driver, then you can always create a custom driver S-function block to use it with Simulink.
  2 commentaires
Ola Martner
Ola Martner le 24 Mai 2012
Thank you. What about the compass sensor, <http://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action&key=NMC1034> It is supported by the nxtOSEK environment, but has no ready simulink block to get the sensor value. What is the easiest way to use this sensor?
Kaustubha Govind
Kaustubha Govind le 24 Mai 2012
Ola: Like I mentioned, you can write a custom S-function driver block to simply call into the corresponding nxtOSEK API function in the generated code. Your S-function itself should be a no-op, but you can write a TLC file to call into it. If you've not done this before, I would recommend using an S-function Builder block (http://www.mathworks.com/help/toolbox/simulink/slref/sfunctionbuilder.html) to automatically generate the S-function and TLC for you. Then, manually edit the S-function and remove the calls to the nxtOSEK functions, so that it is a no-op.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur LEGO MINDSTORMS EV3 Hardware dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by