Gait example without IK and delay

Hi,

for my quadruped (8 Servos on an UNO) I am preparing the gait code. I want to start without IK to keep it simple (if there is a good IK example out the I might rethink).
I was not able to find smaple gait code without IK and without delay statements. Does someone have a working example?
I have some ideas on how to do it. But I don't want to reinvent the wheel if not needed.

Thanks
Robert

Any code that involves delays can be replaced with a state machine and the BlinkWithoutDelay trick. Like in this example where the function is called repeatedly to run through Red Yellow and Green lights on a fixed schedule.

void threelight(){
  unsigned long currentMillis = millis();
  switch (lightState)
  {
  case GREEN: 
    if (currentMillis - previousMillis > greenInterval)
    {
      previousMillis = currentMillis; //Re-start timer
      lightState = YELLOW;
      setColor(YELLOW);
    }
    break;

  case YELLOW:
    if (currentMillis - previousMillis > yellowInterval)
    {
      previousMillis = currentMillis; //Re-start timer
      lightState = RED;
      setColor(RED);
    }
    break;

  case RED:
    if (currentMillis - previousMillis > redInterval)
    {
      previousMillis = currentMillis;  //Re-start timer
      lightState = GREEN;
      setColor(GREEN);
    }
    break;

  default: 
    lightState = GREEN;
    previousMillis = currentMillis;
    setColor(GREEN);
  }
}

Hi Johnwasser,

thanks for hte reply. This I knew. Thanks anyway.
It's really about timing a gait with the least effort.

The way I approach it now is to cut the gait into timewise equal steps and to put the servo positions for all steps into a two dimentional array.
Then execute the next step when millis() hits waitgait.

Robert