Intializing the legs to start at a stable position.

This piece of code is used to initialize the legs to the correct starting position. For using this code, you need to first count the number of transitions of the encoder wheel you want to correct the leg by. Enter these numbers into the array termed as transition_count. The positions in the array signify the error for the particular motor.

Then dump the code and watch the R-Hex prototpye come to the stable position.

Note: Motor number 1 works only in 1 direction and hence the difference in working it out.