Implement changing color test for SK6812
This commit is contained in:
parent
f2183c5dac
commit
f31160964b
@ -16,14 +16,17 @@ static void wait_for_ticks(uint32_t ticks)
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
uint32_t led_val = 0xAAUL;
|
||||||
|
|
||||||
RCC->AHBENR |= RCC_AHBENR_GPIOAEN;
|
RCC->AHBENR |= RCC_AHBENR_GPIOAEN;
|
||||||
GPIOA->MODER |= (1<<3*2);
|
GPIOA->MODER |= (1<<3*2);
|
||||||
SysTick_Config(800000);
|
SysTick_Config(800000);
|
||||||
while(1) {
|
while(1) {
|
||||||
__disable_irq();
|
__disable_irq();
|
||||||
sk6812_send_led(0x000000FF);
|
sk6812_send_led(led_val);
|
||||||
__enable_irq();
|
__enable_irq();
|
||||||
wait_for_ticks(30);
|
wait_for_ticks(30);
|
||||||
|
led_val += 20;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user