Arduino code to Simulink

조회 수: 6 (최근 30일)
Thibault Ghyselen
Thibault Ghyselen 2019년 3월 29일
답변: Pradeep KS 2019년 4월 10일
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
madhan ravi
madhan ravi 2019년 3월 29일
Which code? Have you downloaded the Simulink arduino Hardware package?
Thibault Ghyselen
Thibault Ghyselen 2019년 3월 29일
The code that I need to convert is the following:
Knipsel.PNG
I've downloaded the simulink support package for Arduino Hardware.
Knipsel.PNG

댓글을 달려면 로그인하십시오.

답변 (1개)

Pradeep KS
Pradeep KS 2019년 4월 10일
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.

카테고리

Help CenterFile Exchange에서 Device Driver Blocks에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by