[AT32F407] 雅特力AT-START-F407 GPIO测试 LED 三

[复制链接]
 楼主| trucyw 发表于 2021-2-19 17:43 | 显示全部楼层 |阅读模式
本帖最后由 trucyw 于 2021-2-19 17:47 编辑

今天终于有时间测试测试板LED
0a31c053741a1b0162520391530ba85.jpg
如上LED测试
        //LED管脚初始化
        GPIO_InitType GPIO_InitStructure;
        RCC_APB2PeriphClockCmd(RCC_APB2PERIPH_GPIOD, ENABLE);
        GPIO_StructInit(&GPIO_InitStructure);
        GPIO_InitStructure.GPIO_Pins =GPIO_Pins_13|GPIO_Pins_14|GPIO_Pins_15;
        GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT_PP;
        GPIO_InitStructure.GPIO_MaxSpeed = GPIO_MaxSpeed_50MHz;        
        GPIO_Init(GPIOD,&GPIO_InitStructure);

测试代码如下
                GPIO_ResetBits(GPIOD,GPIO_Pins_13);
                Delay_ms(300);
                GPIO_ResetBits(GPIOD,GPIO_Pins_14);
                Delay_ms(300);
                GPIO_ResetBits(GPIOD,GPIO_Pins_15);
                Delay_ms(300);
                GPIO_SetBits(GPIOD,GPIO_Pins_15);               
                Delay_ms(300);
                GPIO_SetBits(GPIOD,GPIO_Pins_14);               
                Delay_ms(300);               
                GPIO_SetBits(GPIOD,GPIO_Pins_13);               
                Delay_ms(300);

测试结束
您需要登录后才可以回帖 登录 | 注册

本版积分规则

43

主题

754

帖子

2

粉丝
快速回复 返回顶部 返回列表