大家帮看看为什么这样配置GPIO就不好使呢?

[复制链接]
436|0
 楼主| 怎么叫都可以 发表于 2018-7-6 09:10 | 显示全部楼层 |阅读模式
我想使用PF0、PF1、PF2、PF3,这4个管教控制两个电机的IN1,IN2,IN3,IN4管脚,GPIO配置如下
void LED_Init(void)
{            
  GPIO_InitTypeDef  GPIO_InitStructure;

  RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOF, ENABLE);//
        
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1| GPIO_Pin_2| GPIO_Pin_3;
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;//
  GPIO_InitStructure.GPIO_OType = GPIO_OType_OD;//????
  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;//100MHz
  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;//
  GPIO_Init(GPIOF, &GPIO_InitStructure);//
        
  GPIO_SetBits(GPIOF,GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3);
}

根据例程中的LED程序改的,谢谢啦,帮看一看!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

457

主题

483

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部