Arduino Setup() function using simulink

조회 수: 3 (최근 30일)
Gianluca
Gianluca 2016년 1월 7일
댓글: Gianluca 2016년 1월 7일
Hi, is there a way to create in a Simulink model for Arduino Due (embedded coder) the equivalent of the Setup() function, I mean a function that prepares everything and runs just once before the loop starts? I'm trying to read through i2c some sensors that need to be initialized and I can't find a way to create this kind of sequential workflow. Thank you
  댓글 수: 2
Madhu Govindarajan
Madhu Govindarajan 2016년 1월 7일
the latest version of Simulink support package for Arduino has an I2C block. For your purpose have you looked into the possibility of using S-function blocks?
Gianluca
Gianluca 2016년 1월 7일
Hi, thank you for the attention. I know about the I2C block of the Simulink support package. I have a basic understanding of S-Function and I don't see how they can be used to write code that must be executed just once, before the simulation loop begins. Could you please point me to an example?

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Arduino Hardware에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by