Biped Coding Issues

SilentDemon555:
Could I just use different interval variables to call different moves?
IE: Interval1 = 1 second
Interval2 = 1.5 seconds

Move leg 1 on interval1
Move leg 2 on interval2

You could, but if you are not very careful then they may get out of sync. Better to use an interval of 0.5 seconds, and schedule leg 1 to move after 2 intervals and leg 2 to move after 3 intervals.

Have you considered something like the following:

  • in setup() move all servos to their starting positions. You can use delay calls here to avoid driving them all at the same time, if you need to do this to avoid overloading your power supply.
  • break the walking cycle (i.e. one pair of steps) down into equally spaced time intervals, where at each point you move just a small number of servos (perhaps just one) or do nothing
  • construct a table to specify at each point in the cycle which servo(s) you need to move and where you need to move them to
  • then loop() can just iterate through the table, waiting until the appropriate time before moving on to the next point in the cycle