MATLAB Answers

0

Arduino Interrupts

Asked by Curtis Bower on 30 Mar 2012
Latest activity Answered by Arun Kumar on 15 Oct 2019 at 4:12
I wish to use the "Arduino Support for Simulink" to write code in Simulink and use it on an Arduino. But, I need to be able to incorporate interrupts in order to read the output from a quadrature encoder. Does Simulink support this? If not is there a way to access the sketch file before it is complied to add some more functionality that Simulink is lacking?

  1 Comment

mahmoud bakr on 1 Apr 2019
If you mean that you want to gey the encoder info i.e(speed,steps) you can do that in simulink without using interrupts refer to the built in example in the arduino support packages examples named ( Driving car with PID controller )

Sign in to comment.

4 Answers

Answer by Gautam Vallabha on 1 Apr 2012

I assume you are referring to the Run on Target Hardware support for Arduino.
There is currently no support for working with Arduino interrupts from within Simulink. If you have Embedded Coder, you can access the generated code (the sketch) before it is compiled. Otherwise (if you just have Simulink) there is no way to access the generated code.

  0 Comments

Sign in to comment.


fox tan
Answer by fox tan
on 15 Sep 2013

Hi,Gautam Vallabha : I want to create a interrupt block of Arduino. Can you give an example to me about what you wrote " If you have Embedded Coder, you can access the generated code (the sketch) before it is compiled. "
thanks very much!

  1 Comment

phil
on 4 Apr 2014
have you been succesfull with this? this would come in very handy!

Sign in to comment.


Answer by Christoph Hahn on 4 Oct 2016

Dear Curtis,
you can check out that entry on the FileExchange LINK. You can use the template for creating custom S-function blocks.
Cheers Christoph

  0 Comments

Sign in to comment.


Answer by Arun Kumar on 15 Oct 2019 at 4:12

  0 Comments

Sign in to comment.