Let's Make Robots!

Math Library

Hi,

I'm having trouble with my formulas, I checked it many times but I dont seem to get the right codes to use. 
I am trying to move one leg of my Hexapod with 3DOF with positions(X,Y,Z) as pos(5,3,2) to find the angles A(coxa), B(femur) and C(tibia) but it always has errors.

My guess is that, I dont have math.h library on my sketch. But when I tried to download for one, there ain't no ready made library and I dont know how to do it on ( .h ) file... so anyone has it? Or if there really is problem with my code. Here's my code:

 

Control 12 Servos using Arduino Mega

Hi!

I'm a newbie and am currently doing my first ever Hexapod ROBOT with 18servo motors controlled using Arduino Mega ADK. I already control 6 servos using 4 pins from arduino (pins 8,9,10,11). However, when i tried controlling the other 6 servos with 4 other pins, something went wrong. it doesnt word at all. It's seems it's my codes fault. Here's my code:

 

 

 

#include <Servo.h>

 

Servo servoa;             // Define a servo

Servo servob;