joint wave - ksoltan/RoboFish GitHub Wiki
joint-wave.ino
Controls a 4-jointed fish, tested on the Love (1st iteration) fish. A joint is moved every 125ms, starting from the first (head) joint, then the second joint, third joint, and the tail.
Variable:
NUM_JOINTS: number of joints in the system
joint_directions: each bit of the integer represents a different joint.
Returns:
Angle between vector defined by pt1 and pt2 from horizontal.
-180 < theta < 180