MATLAB Answers

0

How can I use the function millis() for Arduino in Matlab?

Asked by Kim Soltau on 12 Jun 2019
Latest activity Commented on by Walter Roberson
on 12 Jun 2019
Hello,
I want to use a function like millis() in Matlab to control my Arduino MEGA without delay.
I have the Arduino Support Package, but when I want to use "millis()", there is an error "undefined function".
Is there a function with the same functions in Matlab?
Thanks for your help!

  0 Comments

Sign in to comment.

2 Answers

Answer by Walter Roberson
on 12 Jun 2019

You can look at etime or at tic and toc,
However there is no way to control arduino without delay.
In particular the standard connection of serial over USB can be fired at most 1000 times per second and typically less. It is common for people to have difficulty exceeding 40 Hz unless they write custom code on the arduino side.
In theory you might be able to achieve lower latency with an Ethernet connection, but I do not mean wireless.

  0 Comments

Sign in to comment.


Answer by Vishnu Vardhan on 12 Jun 2019
Edited by Walter Roberson
on 12 Jun 2019

you can use temporalCount() function.

  1 Comment

I am not clear how knowing the number of times a chart has woken up helps control an arduino??

Sign in to comment.