资源简介

STM32F103ZET控制WS2811/SM16703P驱动RGB全彩LED呼吸灯。本人已用示波器确定好归零码时序,可直接使用。

资源截图

代码片段和文件信息

#include “led.h“
u8 LED_data[45][3]={
{550255}//GRB
{1000200}
{1550155}
{2000100}
{255055}//5
{25500}
{25500}
{25500}
{25500}
{25500}
{25500}
{25500}
{25500}
{25500}
{25500}//15
{255550}
{2001000}
{1551550}
{1002000}
{552550}//20
{02550}//GRB
{02550}
{02550}
{02550}
{02550}
{02550}
{02550}
{02550}
{02550}
{02550}//30
{025555}//GRB
{0200100}
{0155155}
{0100200}
{055255}
{00255}//35
{00255}
{00255}
{00255}
{00255}
{00255}
{00255}
{00255}
{00255}
{00255}//45
            };


/*******************************************************************************
* 函 数 名         : delay
* 函数功能    : 延时函数,delay(6000000)延时约1s
* 输    入         : i
* 输    出         : 无
*******************************************************************************/
void delay(u32 i)   
{
while(i--);
}

/*******************************************************************************
* 函 数 名         : LED_Init
* 函数功能    : LED初始化函数
* 输    入         : 无
* 输    出         : 无
*******************************************************************************/
void LED_Init()   //端口初始化
{
GPIO_InitTypeDef GPIO_InitStructure; //声明一个结构体变量,用来初始化GPIO

SystemInit(); //时钟初始化
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOCENABLE);

/*  配置GPIO的模式和IO口 */
GPIO_InitStructure.GPIO_Pin=LED;  //选择你要设置的IO口
GPIO_InitStructure.GPIO_Mode=GPIO_Mode_Out_PP;  //设置推挽输出模式
GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;   //设置传输速率
GPIO_Init(GPIOC&GPIO_InitStructure);     /* 初始化GPIO */
}

/*******************************************************************************
* 函 数 名         : led_display
* 函数功能    : LED显示函数  LED闪烁
* 输    入         : 无
* 输    出         : 无
*******************************************************************************/
/*void send_low()
{
GPIO_SetBits(GPIOCLED);
__NOP();__NOP();__NOP();
//__NOP();__NOP();__NOP();
//delay(1);//延时约为1s
GPIO_ResetBits(GPIOCLED);
__NOP();__NOP();__NOP();__NOP();__NOP();
__NOP();__NOP();__NOP();__NOP();__NOP();
__NOP();__NOP();__NOP();__NOP();__NOP();
__NOP();__NOP();__NOP();__NOP();__NOP();
__NOP();__NOP();__NOP();__NOP();__NOP();
}*/

void send_low()
{
GPIO_SetBits(GPIOCLED);
__NOP();__NOP();__NOP();
__NOP();__NOP();__NOP();
__NOP();__NOP();__NOP();
__NOP();__NOP();__NOP();
__NOP();__NOP();__NOP();
__NOP();__NOP();__NOP();
__NOP();__NOP();__NOP();
__NOP();__NOP();__NOP();
//__NOP();__

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-08-29 09:58  RGB LED\
     目录           0  2018-08-29 09:56  RGB LED\APP\
     目录           0  2018-08-29 09:56  RGB LED\APP\SysTick\
     文件        1314  2015-05-28 11:25  RGB LED\APP\SysTick\systick.c
     文件         121  2014-12-09 16:09  RGB LED\APP\SysTick\systick.h
     目录           0  2018-08-29 09:58  RGB LED\APP\led\
     文件        5089  2018-08-29 09:58  RGB LED\APP\led\led.c
     文件         299  2018-08-28 15:39  RGB LED\APP\led\led.h
     目录           0  2018-08-29 09:56  RGB LED\DebugConfig\
     文件        6956  2015-12-10 17:06  RGB LED\DebugConfig\Target_1_STM32F103ZE_1.0.0.dbgconf
     文件         339  2018-08-28 15:43  RGB LED\EventRecorderStub.scvd
     文件         497  2017-04-19 22:03  RGB LED\Jlink Regs CM3.txt
     文件       62859  2018-08-28 16:22  RGB LED\JlinkLog.txt
     文件         285  2015-03-17 08:57  RGB LED\JlinkSettings.ini
     目录           0  2018-08-29 09:56  RGB LED\Libraries\
     目录           0  2018-08-29 09:56  RGB LED\Libraries\CMSIS\
     目录           0  2018-08-29 09:56  RGB LED\Libraries\CMSIS\CM3\
     目录           0  2018-08-29 09:56  RGB LED\Libraries\CMSIS\CM3\CoreSupport\
     文件       17273  2010-06-07 10:25  RGB LED\Libraries\CMSIS\CM3\CoreSupport\core_cm3.c
     文件       85714  2011-02-09 14:59  RGB LED\Libraries\CMSIS\CM3\CoreSupport\core_cm3.h
     目录           0  2018-08-29 09:56  RGB LED\Libraries\CMSIS\CM3\DeviceSupport\
     目录           0  2018-08-29 09:56  RGB LED\Libraries\CMSIS\CM3\DeviceSupport\ST\
     目录           0  2018-08-29 09:56  RGB LED\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\
     文件       26297  2011-03-14 12:31  RGB LED\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\Release_Notes.html
     目录           0  2018-08-29 09:56  RGB LED\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\
     目录           0  2018-08-29 09:56  RGB LED\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\TrueSTUDIO\
     文件       12604  2011-03-10 10:54  RGB LED\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\TrueSTUDIO\startup_stm32f10x_cl.s
     文件       12592  2011-03-10 10:53  RGB LED\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\TrueSTUDIO\startup_stm32f10x_hd.s
     文件       12239  2011-03-10 10:53  RGB LED\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\TrueSTUDIO\startup_stm32f10x_hd_vl.s
     文件        9826  2011-03-10 10:53  RGB LED\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\TrueSTUDIO\startup_stm32f10x_ld.s
     文件       10275  2011-03-10 10:53  RGB LED\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\TrueSTUDIO\startup_stm32f10x_ld_vl.s
............此处省略170个文件信息

评论

共有 条评论