Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
HEXAPOD_LEG.h
00001 #ifndef HEXAPOD_LEG_LIBRARY_H 00002 #define HEXAPOD_LEG_LIBRARY_H 00003 00004 #include "PCA9685.h" 00005 #include "mbed.h" 00006 #include "structs.h" 00007 00008 class Hexapod_Leg { 00009 00010 public: 00011 Hexapod_Leg(PCA9685 Driver, calibrated_leg_centre leg_cent, calibrated_leg_1_degree leg_step, leg_outputs leg_out, bool ON_RHS); 00012 void set_joint_angles(float angle_a, float angle_b, float angle_c); 00013 void set_leg_position(leg_x_angles angles); 00014 00015 private: 00016 float angle_to_pwm(float angle, char joint); 00017 00018 private: 00019 float a_ref; 00020 float b_ref; 00021 float c_ref; 00022 00023 float a_1deg; 00024 float b_1deg; 00025 float c_1deg; 00026 00027 int a_pin; 00028 int b_pin; 00029 int c_pin; 00030 00031 bool RHS; 00032 00033 PCA9685 driver; 00034 00035 }; 00036 00037 00038 00039 00040 #endif
Generated on Wed Jul 13 2022 04:18:01 by
1.7.2