PID motor controll for the biorobotics project.
Dependents: PID_example Motor_calibration Demo_mode Demo_mode ... more
Diff: motor.h
- Revision:
- 5:5537072b0e2e
- Parent:
- 4:5353c5d0d2ed
- Child:
- 7:eb8787e7a5f5
--- a/motor.h Wed Oct 31 06:13:15 2018 +0000 +++ b/motor.h Wed Oct 31 06:41:39 2018 +0000 @@ -41,12 +41,15 @@ // Set the angle the motor needs to rotate to. In radians. void set_target_angle(double angle); void set_pid_k_values(double k_p, double k_i, double k_d); + // Starts the motor controller with the specified update period. void start(float period); - // Stops the motor immediately. void stop(); + // Makes the current angle the new 0 point. + void set_current_angle_as_zero(); + // Returns the current angle of the motor. double get_current_angle();