How can I make a loop for sending a signal in form of step, using only Matlab and Arduino Mega 2560 (not Simulink nor step function itself)?
1 次查看(过去 30 天)
显示 更早的评论
Hi everyone
I'm working with arduino Mega 2560 and Matlab and I'm using the function "writePWMVoltage" for sending a specific voltage to outside.
My issue is the following situation:
I don't know how to make a loop for creating a "step" signal (without using the function of matlab itself, nor Simulink).
For example, I want to send a voltage of 2 volts since t = 0 to 30 seconds, and from the instant 31 second, send a voltage of 2.5 Volts (If you see, this is like a "step function")
I'm trying with the functions "for", "while", and I don't know how to get this thing, it appears some errors, I'm a amateur in programation.
Please help me.
Thank you so much for reading and answer me in advance.
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Arduino Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!