This commit is contained in:
2025-06-18 09:08:17 +08:00
commit 7999439a8f
363 changed files with 313769 additions and 0 deletions

31
USER/led.c Normal file
View File

@ -0,0 +1,31 @@
#include "led.h"
int lednumbernow=0;
//LED IO初始化
void LED_Init(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE); //使能PB,PE端口时钟
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOB, &GPIO_InitStructure);
GPIO_SetBits(GPIOB,GPIO_Pin_12);
}
void ledloop(void)
{
lednumbernow++;
if (lednumbernow>200)
{
LED0=!LED0;
lednumbernow=0;
}
}