论坛元老
 
- 积分
- 3348
- 金钱
- 3348
- 注册时间
- 2013-5-28
- 在线时间
- 468 小时
|
发表于 2021-2-26 14:10:34
|
显示全部楼层
int main()
{
delay(1000000);
GPIO_InitTypeDef GPIO_InitStructure;
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOB, ENABLE);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(GPIOB, &GPIO_InitStructure);
GPIO_ResetBits(GPIOB, GPIO_Pin_1);
while(1)
{
delay(1000000);
GPIO_ResetBits(GPIOB, GPIO_Pin_1);
delay(1000000);
GPIO_SetBits(GPIOB, GPIO_Pin_1);
}
//return 0;
}
|
|