Introducing delays in switch case


i have following switch case code sends data received on serial unique servo:

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.


Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > Introducing delays in switch case


arduino

Comments

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums