Programming an Arduino Mega and a Mega Sensor Shield V2 for use in a Hexapod

If you detail specifically what the problem is then you will find PaulS can be extremely helpful.

What errors are you getting? When do you get them?