ROBOTIS e-Manual v1.13.01
Learning ollo servo motor rotation direction
CM-530
OLLO servo motor (Connected to the external port No.1)
The controller controls rotation direction with MOT1+ and MOT1- via SIG_MOT1+ and SIG_MOT1-


Refer to controller’s port for port and pin number in 06 OLLO MOTOR ROTATE\APP\src\main.c
int main(void) { /* System Clocks Configuration */ RCC_Configuration(); /* NVIC configuration */ NVIC_Configuration(); /* GPIO configuration */ GPIO_Configuration(); SysTick_Configuration(); GPIO_ResetBits(PORT_SIG_MOT1P,PIN_SIG_MOT1P); GPIO_ResetBits(PORT_SIG_MOT1M,PIN_SIG_MOT1M); GPIO_ResetBits(PORT_LED_POWER, PIN_LED_POWER);
while(1) { GPIO_SetBits(PORT_SIG_MOT1P,PIN_SIG_MOT1P); GPIO_ResetBits(PORT_SIG_MOT1M,PIN_SIG_MOT1M); mDelay(5000); GPIO_SetBits(PORT_SIG_MOT1M,PIN_SIG_MOT1M); mDelay(5000); GPIO_SetBits(PORT_SIG_MOT1P,PIN_SIG_MOT1P); GPIO_SetBits(PORT_SIG_MOT1M,PIN_SIG_MOT1M); mDelay(2000); } return 0; } |
The servo motor rotates for 5 seconds and repeats rotating after a 2-second halt.