Introducing delays in switch case
i have following switch case code sends data received on serial unique servo:
in cases servos should have 15 ms reach destination before receiving new data new destination. if introduce "delay(15)" before each break apply servo receives data, or delay other cases receiving information? i have servos chance go destination.
code: [select]
switch (servo) {
case 1:
servo8.write(pos); // move servo1 'pos'
break;
case 2:
servo9.write(pos);
break;
case 3:
servo10.write(pos);
break;
case 4:
servo11.write(pos);
break;
case 5:
servo12.write(pos);
break;
}
delay(10); in cases servos should have 15 ms reach destination before receiving new data new destination. if introduce "delay(15)" before each break apply servo receives data, or delay other cases receiving information? i have servos chance go destination.
if add delay statements, whole program delay while servo moves. set flag each servo indicates whether ready move again, , command it, if ready move.
that involve queue class, though, able queue commands each servo.
how far servo move in each operation? may not necessary have delays beyond of serial processing, if moves small.
that involve queue class, though, able queue commands each servo.
how far servo move in each operation? may not necessary have delays beyond of serial processing, if moves small.
Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > Introducing delays in switch case
arduino
Comments
Post a Comment