久久ER99热精品一区二区-久久精品99国产精品日本-久久精品免费一区二区三区-久久综合九色综合欧美狠狠

新聞中心

EEPW首頁 > 嵌入式系統 > 設計應用 > STM32F1003BR基于3.5固件庫的LED燈

STM32F1003BR基于3.5固件庫的LED燈

作者: 時間:2016-12-01 來源:網絡 收藏
#include "stm32f10x.h"

/***********************************************************************
************************************************************************/
GPIO_InitTypeDef GPIO_InitStructure;
/***********************************************************************
************************************************************************/
void delay(vu32 nCount)
{
for(; nCount != 0; nCount--);
}
/***********************************************************************
************************************************************************/
main()
{
/* GPIOD Periph clock enable */
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOD, ENABLE);

/* Configure PD0 and PD2 in output pushpull mode */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOD, &GPIO_InitStructure);

本文引用地址:http://cqxgywz.com/article/201612/324394.htm

while(1)
{
GPIO_ResetBits(GPIOD,GPIO_Pin_2);
delay(5000000);
GPIO_SetBits(GPIOD,GPIO_Pin_2);
delay(5000000);
}
}

/*PD.2端口接LED燈,循環亮滅*********************************************
************************************************************************/



評論


技術專區

關閉