writeDigitalPin using MATLAB is very slow

Hello,

I am using MATLAB 2020 to control my Arduino Mega. However, I noticed that writeDigitalPin takes around 35 milliseconds to execute, which is quite slow when compared to the IDE option. Do you know of any workaround to speed this up?

I saw some threads regarding this topic here in the forum but none of them solves this issue for this MATLAB version.

Thank you in advance for your help,

1 Like

Post your sketch, well formated, with comments and in so called code tags "</>" to see how we can help.

All but about 4 microseconds of that time is spent communicating back and forth with MATLAB, so that communication is the real problem.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.