STM32F103_WS2812B灯带pwm+dma方式驱动控制程序软件源码
#include "sys.h"
#include "delay.h"
#include "usart.h"
#include "ws2812b.h"
#define mode 1 //mode = 1为呼吸灯 mode = 2为流水灯
int main(void)
{
// u8 r,g,b;
delay_init(); //延时函数初始化
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2); //设置NVIC中断分组2:2位抢占优先级,2位响应优先级
uart_init(9600);
Timer2_init();
// WS2812_Clear();
while(1)
{
Led_Mode(mode);
}
}