ROBOTIS e-Manual v1.13.01
Each LED of the controller can be controlled.
CM-530
The micro controller can control the peripheral devices such as LED connected to the controller through I/O Port. You can control LEDs on the controller using this example.
Refer to controller’s port for port and pin number in 01 LED\app\src\main.c
int main(void) { /* System Clocks Configuration */ RCC_Configuration(); /* NVIC configuration */ NVIC_Configuration(); /* Configure the GPIO ports */ GPIO_Configuration(); SysTick_Configuration();
while(1) { GPIO_SetBits(PORT_LED_POWER, PIN_LED_POWER); GPIO_ResetBits(PORT_LED_MANAGE, PIN_LED_MANAGE); mDelay(250); GPIO_SetBits(PORT_LED_MANAGE, PIN_LED_MANAGE); GPIO_ResetBits(PORT_LED_PROGRAM, PIN_LED_PROGRAM); mDelay(250); GPIO_SetBits(PORT_LED_PROGRAM, PIN_LED_PROGRAM); GPIO_ResetBits(PORT_LED_PLAY, PIN_LED_PLAY); mDelay(250); GPIO_SetBits(PORT_LED_PLAY, PIN_LED_PLAY); GPIO_ResetBits(PORT_LED_TX, PIN_LED_TX); mDelay(250); GPIO_SetBits(PORT_LED_TX, PIN_LED_TX); GPIO_ResetBits(PORT_LED_RX, PIN_LED_RX); mDelay(250); GPIO_SetBits(PORT_LED_RX, PIN_LED_RX); GPIO_ResetBits(PORT_LED_AUX, PIN_LED_AUX); mDelay(250); GPIO_SetBits(PORT_LED_AUX, PIN_LED_AUX); GPIO_ResetBits(PORT_LED_POWER, PIN_LED_POWER); mDelay(250); } return 0; } |
All LEDs will be turned on in order.