请大神指点迷津啊。
俺买了普中stm32f407zgt6小系统板,将普中板教学库函数点亮F端口9脚LED实验程序修改成点亮E端口12脚LED,已经在E12脚外接LED。下载程序进入系统板的结果是F9脚LED亮着,E12脚LED没啥反应。
led.c //原文件
#include "led.h"
void LED_Init()
{
GPIO_InitTypeDef GPIO_InitStructure; //定义结构体变量
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOE,ENABLE); //使能端口E时钟
GPIO_InitStructure.GPIO_Mode=GPIO_Mode_OUT; //输出模式
GPIO_InitStructure.GPIO_Pin=GPIO_Pin_12;//管脚设置E12
GPIO_InitStructure.GPIO_Speed=GPIO_Speed_100MHz;//速度100MHz
GPIO_InitStructure.GPIO_OType=GPIO_OType_PP;//推挽输出
GPIO_InitStructure.GPIO_PuPd=GPIO_PuPd_UP;//上拉
GPIO_Init(GPIOE,&GPIO_InitStructure); //初始化结构体
GPIO_SetBits(GPIOE,GPIO_Pin_12);//高位输出
}
*********************
led.h //头文件
#ifndef _led_H
#define _led_H
#include "stm32f4xx.h"
void LED_Init(void);
#endif
*************************
//普中使用库函数点亮LED灯
//主函数
#include "stm32f4xx.h"
#include "led.h"
int main()
{
LED_Init();
while(1)
{
GPIO_ResetBits(GPIOE,GPIO_Pin_12); //¸复位E12,点亮LED12.
}
}
请热心大神教教俺啊。这点亮E端口12脚的LED程序为啥点亮的仍然是F端口9脚LED。
俺买了普中stm32f407zgt6小系统板,将普中板教学库函数点亮F端口9脚LED实验程序修改成点亮E端口12脚LED,已经在E12脚外接LED。下载程序进入系统板的结果是F9脚LED亮着,E12脚LED没啥反应。
led.c //原文件
#include "led.h"
void LED_Init()
{
GPIO_InitTypeDef GPIO_InitStructure; //定义结构体变量
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOE,ENABLE); //使能端口E时钟
GPIO_InitStructure.GPIO_Mode=GPIO_Mode_OUT; //输出模式
GPIO_InitStructure.GPIO_Pin=GPIO_Pin_12;//管脚设置E12
GPIO_InitStructure.GPIO_Speed=GPIO_Speed_100MHz;//速度100MHz
GPIO_InitStructure.GPIO_OType=GPIO_OType_PP;//推挽输出
GPIO_InitStructure.GPIO_PuPd=GPIO_PuPd_UP;//上拉
GPIO_Init(GPIOE,&GPIO_InitStructure); //初始化结构体
GPIO_SetBits(GPIOE,GPIO_Pin_12);//高位输出
}
*********************
led.h //头文件
#ifndef _led_H
#define _led_H
#include "stm32f4xx.h"
void LED_Init(void);
#endif
*************************
//普中使用库函数点亮LED灯
//主函数
#include "stm32f4xx.h"
#include "led.h"
int main()
{
LED_Init();
while(1)
{
GPIO_ResetBits(GPIOE,GPIO_Pin_12); //¸复位E12,点亮LED12.
}
}
请热心大神教教俺啊。这点亮E端口12脚的LED程序为啥点亮的仍然是F端口9脚LED。