高级会员

- 积分
- 516
- 金钱
- 516
- 注册时间
- 2014-5-16
- 在线时间
- 7 小时
|
【NUCLEO-F411RE】的LED例程
用户LED的IO口,默认PA5。
注意:F411的板子的频率为100M,所以,main函数延迟函数的初始化(使用原子哥的延迟函数文件)如下设置:
delay_init(100);
IO口如下设置:
void LED_Init(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5;//LED0¶Ôó|IO¿ú
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_Init(GPIOA, &GPIO_InitStructure);
GPIO_SetBits(GPIOA,GPIO_Pin_5);
}
|
|