日本a√视频在线,久久青青亚洲国产,亚洲一区欧美二区,免费g片在线观看网站

        <style id="k3y6c"><u id="k3y6c"></u></style>
        <s id="k3y6c"></s>
        <mark id="k3y6c"></mark>
          
          

          <mark id="k3y6c"></mark>

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > STM32基于3.5庫的LED燈2

          STM32基于3.5庫的LED燈2

          作者: 時間:2016-12-01 來源:網(wǎng)絡(luò) 收藏
          3.5的庫在這里:http://www.51hei.com/mcu/2765.html

          #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 PD.2 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://yuyingmama.com.cn/article/201612/324406.htm


          RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);

          /* Configure PA.8 in output pushpull mode */
          GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8;
          GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
          GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
          GPIO_Init(GPIOA, &GPIO_InitStructure);


          while(1)
          {
          GPIO_ResetBits(GPIOD,GPIO_Pin_2); //設(shè)置所選定的端口的一個或多個所選定的位為低
          GPIO_WriteBit(GPIOA,GPIO_Pin_8,Bit_SET); //置位或清除所選定的特定位
          delay(5000000);
          GPIO_SetBits(GPIOD,GPIO_Pin_2); //設(shè)置所選定的端口的一個或多個所選定的位為高
          GPIO_WriteBit(GPIOA,GPIO_Pin_8,Bit_RESET); //置位或清除所選定的特定位
          delay(5000000);
          }
          }

          /*PD.2和PA.8端口接LED燈,循環(huán)亮滅*********************************************
          *****************************************************************************/



          關(guān)鍵詞: STM3235庫LED

          評論


          技術(shù)專區(qū)

          關(guān)閉