MATLAB Answers

0

replicating Arduino pulseIn() on Matlab

Asked by Mauricio Gallegos on 14 Jun 2017
Latest activity Answered by Nagarjuna Manchineni on 21 Jun 2017
Long story short I have to replicate the Arduino pulseIn() command in MatLAB reading in an acceleration X and Y component. I was doing research and found that this link:
https://www.mathworks.com/matlabcentral/answers/33710-how-to-replicate-an-arduino-timer-function-in-matlab
had a similar request but the "adiosrv.pde" file is outdated and the native command (tic, toc) for Matlab is not consistent enough to give me the accurate readings I need for this project. Apparently the .pde file has changed name and/or been split up into multiple documents and I cannot find it anywhere for the life of me. any input?

  0 Comments

Sign in to comment.

1 Answer

Answer by Nagarjuna Manchineni on 21 Jun 2017

I see that the solution in the link that you are referring was written for Giampiy's legacy Arduino library, which I think was the case with the pde file. It is not applicable now.
To measure distance using the new Arduino object, there is an Ultrasonic Sensor add-on library on matlabcentral, but you need to first install a 3rd party library as explained in the instructions on that page.
If this Add-on does not work with your Ultrasonic Sensor, you can use it as a template to create your own custom add-on library.
Here's the doc for creating custom add-on libraries for Arduino.
I hope this helps!

  0 Comments

Sign in to comment.