Arduino code to Simulink

6 vues (au cours des 30 derniers jours)
Thibault Ghyselen
Thibault Ghyselen le 29 Mar 2019
For school I need to read a sensor.
After some work I'm capable to read this with arduino. Is it possible to convert this code to a working Simulink model?
  2 commentaires
madhan ravi
madhan ravi le 29 Mar 2019
Which code? Have you downloaded the Simulink arduino Hardware package?
Thibault Ghyselen
Thibault Ghyselen le 29 Mar 2019
The code that I need to convert is the following:
Knipsel.PNG
I've downloaded the simulink support package for Arduino Hardware.
Knipsel.PNG

Connectez-vous pour commenter.

Réponses (1)

Pradeep KS
Pradeep KS le 10 Avr 2019
There are two approaches depending on the Sensor complexity.
1st approach:
If I2C communication with the sensor is less complex, you can follow the below mentioned example to replicate the same implementation for Xsens IMU sensor.
Create a Simulink model with Arduino I2C blocks to read the data from the sensor.
2nd approach:
If the C/C++ library is already available, you can wrap the library into a Simulink Device driver block by following the below guide.

Catégories

En savoir plus sur Device Driver Blocks dans Help Center et File Exchange

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by