The unified diff between revisions [64de686d..] and [3dc5e7ac..] is displayed below. It can also be downloaded as a raw diff.
This diff has been restricted to the following files: 'thrust.c'
# # old_revision [64de686d701acb9539dc52fe0bff299405612ab0] # new_revision [3dc5e7ac4bcb952cc267892653dd78ed095d8778] # # add_file "thrust.c" # content [cd4c74340b2aaabdc4543f6334d5c44f287e0965] # ============================================================ --- /dev/null +++ thrust.c cd4c74340b2aaabdc4543f6334d5c44f287e0965 @@ -0,0 +1,15 @@ +/* thrust.c */ + +#include "fisqrt.h" +#include "timer.h" + +float linearise_thrust(float x) +{ + return fisqrt(fisqrt(x*x*x)); +} + +void set_thrust(int motor, float x) +{ + timer_set_pwm_value(motor, (int)(linearise_thrust(x) * PWM_MAX)); +} +