I wanted run two motors using Cytron MDD10A Dual Channel motor driver. So my concern is based on execution of code that is done line by line, in that case when I'm driving two motors will this delay in output signal at the PWM pins make a difference in nature of performance i.e. for example a car wheel, in case there is such delay it'll cause one wheel to rotate prior to another which is not desired. If yes, how do I rectify the same. I also wanted to know when I use the delay function does it cause the delay in execution of the previous line or reads the upcoming line upon some 'x' seconds of delay?
Thank you for your help.
edit: code sample:
void FWD() { // to move forward
digitalWrite(m1, HIGH); // motor 1 ON
digitalWrite(m2, HIGH); // motor 2 ON
analogWrite(tm1, 225); // tm1 assigned to a PWM pin
analogWrite(tm2, 225); // tm2 assigned to another PWM pin
}
in the above function I wish to run both analogWrite at the same time as I'm not sure how will it affect the output? I wish for the motors to start at the same time.