新手入门
- 积分
- 9
- 金钱
- 9
- 注册时间
- 2019-2-22
- 在线时间
- 0 小时
|

楼主 |
发表于 2019-2-22 17:06:50
|
显示全部楼层
#include "led.h"
void LED_Init(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOF, ENABLE);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9| GPIO_Pin_10;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;//100MHz
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_Init(GPIOF, &GPIO_InitStructure);
}
像这种基本操作我一般是不会搞错的,换了别的程序即使不设置红灯,红灯一样会亮。 |
|