Library to control a 3DOF leg with a PCA9685.

Revision:
0:ead365546ca5
Child:
1:4c98fa9a06a4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/structs.h	Sat Apr 09 18:57:46 2016 +0000
@@ -0,0 +1,66 @@
+#ifndef HEXAPOD_LEG_STRUCTS_H
+#define HEXAPOD_LEG_STRUCTS_H
+
+struct leg_angles
+
+{    
+
+    float a;    //Body Joint
+    float b;    //Mid Joint
+    float c;    //End Joint
+    
+};
+
+//Calibrated centre positions for all six legs
+
+typedef const struct leg_angles calibrated_leg_centre;
+
+calibrated_leg_centre leg_cent[6] = 
+{
+//    A     B     C
+    {1500, 1545, 2480},         //LEG 1
+    {1475, 1460, 2445},         //LEG 2
+    {1520, 1450, 2490},         //LEG 3
+    {1490, 1535, 490 },         //LEG 4
+    {1480, 1500, 580 },          //LEG 5
+    {1470, 1495, 550 },          //LEG 6
+};
+
+
+typedef const struct leg_angles calibrated_leg_1_degree;
+
+calibrated_leg_1_degree leg_step[6] = 
+{
+//      A       B       C
+    {10.889, 10.167, 10.778},   //LEG 1
+    {10.444, 10.500, 10.444},   //LEG 2
+    {10.667, 10.778, 10.389},   //LEG 3
+    {10.556, 10.333, 10.111},   //LEG 4
+    {10.361, 10.111, 10.611},   //LEG 5
+    {10.806, 10.778, 10.222},   //LEG 6
+};
+
+
+struct pwm_outputs 
+
+{    
+    int a;
+    int b;
+    int c;
+    
+};
+
+
+typedef const struct pwm_outputs leg_outputs;
+
+leg_outputs leg_out[3] = 
+{
+//   A  B  C
+    {0, 1, 2},  //FRONT LEG
+    {3, 4, 5},  //MID LEG
+    {6, 7, 8},  //REAR LEG
+};
+
+      
+        
+#endif
\ No newline at end of file