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.