NEURoboticsClub / Space-Drone-Embedded

Embedded firmware for the Space Building Drone project.
GNU General Public License v3.0
0 stars 0 forks source link

[Control] Implement PWM based-control Servos #7

Open jr1221 opened 1 month ago

jr1221 commented 1 month ago

Implement PWM control servos. This should include a wrapper API and a higher level get_angle, set_angle, etc. It should have an init function to configure GPIOs if needed.

https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/peripherals/mcpwm.html

https://github.com/espressif/esp-idf/blob/master/examples/peripherals/mcpwm/mcpwm_servo_control/main/mcpwm_servo_control_example_main.c

jr1221 commented 1 month ago

Investigate a two layer system, where you have control.c pass in a struct pointer of servo_t to do get_angle, set_angle whatever in servo.c