標(biāo)題: 單片機(jī)音頻產(chǎn)生器Proteus仿真程序 [打印本頁(yè)]

作者: wangxiaoji    時(shí)間: 2020-6-20 09:37
標(biāo)題: 單片機(jī)音頻產(chǎn)生器Proteus仿真程序
  1. #include "led.h"               
  2. #include "beep.h"

  3. void Delay(unsigned int count);                                                  //延時(shí)函數(shù)

  4. int main(void)
  5. {                                 

  6.         LED_Init();         //初始化與LED連接的硬件接口
  7.         BEEP_Init();//喇叭初始化
  8.         while(1)
  9.         {
  10.                 LED0=0;//LED0亮
  11.                 BEEP=0;//蜂鳴器產(chǎn)生聲音
  12.                 Delay(500);
  13.                 LED0=1;
  14.                 BEEP=1;
  15.                 Delay(500);       
  16.                
  17.         }         
  18. }

  19. void Delay(unsigned int count)                                                  //延時(shí)函數(shù)
  20. {
  21.         unsigned int i;
  22.         for(;count!=0;count--)
  23.         {
  24.                 i=5000;
  25.                 while(i--);
  26.         }       
  27. }
復(fù)制代碼


捕獲.PNG (37.66 KB, 下載次數(shù): 42)

捕獲.PNG

音頻產(chǎn)生器.rar

793.33 KB, 下載次數(shù): 3, 下載積分: 黑幣 -5






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