標題: STM32 LED閃滅源程序 [打印本頁]

作者: dongq    時間: 2017-5-6 04:47
標題: STM32 LED閃滅源程序
我的第一個程序
GPIO的配置 -- LED閃滅
按鍵中斷配置 -- 中斷函數(shù)需改進
UART配置 -- 中斷函數(shù)需改進


stm32單片機源程序:
  1. #include "led.h"
  2. #include "UART.h"
  3. #include "NVIC.h"
  4. #include "EXIT.h"

  5. int main(void)
  6. {
  7.                 NVIC_Config();
  8.                 UART_Config();
  9.                 LED_Init();
  10.                 EXIT_ITConfig();
  11.         

  12.          while(1)
  13.         {
  14.                 LedLight2(0);
  15.                 delay(300);
  16.                 LedLight2(1);
  17.                 delay(300);
  18.         }
  19. }

  20. //*********************************利用結構體********************************        
  21. //        while(1)
  22. //        {
  23. //                for(int i=0;i<4;i++)
  24. //                {
  25. //                        int j=0;
  26. //                        LedLight1(1);
  27. //                        delay();
  28. //                        LedLight1(1);

  29. …………限于本文篇幅 余下代碼請從51黑下載附件…………
復制代碼


下載:
手把手拓展 LED.7z (180.36 KB, 下載次數(shù): 9)






歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1