欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標(biāo)題: 單片機(jī)視覺(jué)暫留原理實(shí)驗(yàn) Proteus仿真加源程序 [打印本頁(yè)]

作者: 51黑電子happy    時(shí)間: 2017-3-29 23:18
標(biāo)題: 單片機(jī)視覺(jué)暫留原理實(shí)驗(yàn) Proteus仿真加源程序
單片機(jī)視覺(jué)暫留原理實(shí)驗(yàn)的仿真原理圖(proteus工程文件可到本帖附件下載):


單片機(jī)源程序:
  1. //---------------------------------------------------------------------------
  2. // 程序名:  SZ7-1(1).c
  3. // 程序功能:視覺(jué)暫留原理實(shí)驗(yàn)程序
  4. //---------------------------------------------------------------------------
  5. #include<reg51.h>
  6. sbit LED=P2^7;                                   //定義LED接口
  7. void delay10ms(unsigned int count);

  8. //------------------------------- 主函數(shù)------------------------------

  9. main()
  10.   {
  11.     while (1)                                     //無(wú)限循環(huán)
  12.     {
  13.       LED=0;                                      //點(diǎn)亮LED
  14.       delay10ms(100);                             //調(diào)用延時(shí)模塊,延時(shí)1s
  15.       LED=1;                                      //熄滅LED
  16.       delay10ms(100);                             //調(diào)用延時(shí)模塊,延時(shí)1s                
  17.     }
  18. }     

  19. //------------------------------ 延時(shí)函數(shù) -----------------------------

  20. void delay10ms(unsigned int count)                //總延時(shí)時(shí)間為10ms*count
  21.   {  
  22.     unsigned int i,j,k;         
  23.         for(i=0; i<count; i++)
  24.         for(j=0; j<10; j++)   
  25.                    for(k=0; k<120; k++);
  26.   }

  27. //----------------------------------------------------------------------------
復(fù)制代碼
程序2:
  1. //---------------------------------------------------------------------------
  2. // 程序名:  SZ7-1.c(2)
  3. // 程序功能:視覺(jué)暫留原理實(shí)驗(yàn)程序
  4. //---------------------------------------------------------------------------
  5. #include<reg51.h>
  6. sbit LED=P2^7;                                   //定義LED接口
  7. void delay10ms(unsigned int count);

  8. //------------------------------- 主函數(shù)------------------------------

  9. main()
  10.   {
  11.     while (1)                                    //無(wú)限循環(huán)
  12.     {
  13.       LED=0;                                     //點(diǎn)亮LED
  14.       delay10ms(1);                              //調(diào)用延時(shí)模塊,延時(shí)0.01s
  15.       LED=1;                                     //熄滅LED
  16.       delay10ms(1);                              //調(diào)用延時(shí)模塊,延時(shí)0.01s                
  17.     }
  18. }     

  19. //------------------------------ 延時(shí)函數(shù) -----------------------------
  20. void delay10ms(unsigned int count)              //總延時(shí)時(shí)間為10ms*count
  21.   {  
  22.     unsigned int i,j,k;         
  23.         for(i=0; i<count; i++)
  24.         for(j=0; j<10; j++)   
  25.                    for(k=0; k<120; k++);
  26.   }
  27. //----------------------------------------------------------------------------
復(fù)制代碼




該系列源碼包含有很多非常經(jīng)典,代碼風(fēng)格十分規(guī)范,而且注釋詳細(xì)的單片機(jī)例程,還帶仿真,對(duì)于MCU學(xué)習(xí)特別是初學(xué)者是很有幫助的,全部源碼下載(共25個(gè)項(xiàng)目):http://www.raoushi.com/bbs/dpj-79328-1.html

本例程下載(含proteus仿真工程文件與源碼):
單片機(jī)視覺(jué)暫留原理實(shí)驗(yàn).rar (35.18 KB, 下載次數(shù): 7)








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