Welcome to 16-channel Servo Debugging Board repository
IIC controls the servos
1. Learning objectives
In this course, we will focus on implementing IIC control of servos using the STM32F103RCT6 and 16-way servo drive modules.
2. Prepare before class
In this example, the 16-way servo driver module adopts IIC communication, and the SAD and SCL of the module are connected to the PB7 and PB6 pins of the STM32F103RCT6 board. VCC and GND are connected to the 3.3V and GND of the STM32F103RCT6, respectively.
3. Programming
Initialize IIC, interrupts, delays, etc.
Control the servo S1 with the for cycle, select 5 degrees each time from 0 to 180, and finally return to 0 degrees.
4. Experimental phenomenon
After the program is downloaded, it runs, and the servo goes from 0 degrees to 180 degrees, and then back to 0 degrees.