找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 2535|回復(fù): 0
打印 上一主題 下一主題
收起左側(cè)

模擬花樣廣告燈顯示實驗

[復(fù)制鏈接]
跳轉(zhuǎn)到指定樓層
樓主
ID:72519 發(fā)表于 2015-1-21 23:10 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
是用51hei單片機開發(fā)板 電路圖詳見:http://www.torrancerestoration.com/f/51hei-5.pdf   p1口上面接8個燈.

  1. #include<reg52.h>
  2. #define uchar unsigned char
  3. #define uint unsigned int
  4. uchar code LED1[]={0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe};
  5. uchar code LED2[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
  6. uchar code LED3[]={0x7e,0xbd,0xdb,0xe7,0xe7,0xdb,0xbd,0x7e};
  7. uchar code LED4[]={0x7f,0x3f,0x1f,0x0f,0x07,0x03,0x01,0x00};
  8. uchar code LED5[]={0xfe,0xfc,0xf8,0xf0,0xe0,0xc0,0x80,0x00};
  9. //============
  10. void delay(unsigned int k)
  11. {
  12. unsigned int i,j;
  13. for(i=0;i<k;i++){
  14. for(j=0;j<121;j++)
  15. {;}}
  16. }
  17. //====================
  18. void main(void)
  19. {uchar cnt;
  20. while(1)
  21. {
  22. for(cnt=0;cnt<8;cnt++)
  23. {P1=LED1[cnt];
  24. delay(200);}
  25. //=======
  26. for(cnt=0;cnt<8;cnt++)
  27. {P1=LED2[cnt];
  28. delay(200);}
  29. //===========
  30. for(cnt=0;cnt<8;cnt++)
  31. {P1=LED3[cnt];
  32. delay(200);}
  33. //==========
  34. for(cnt=0;cnt<8;cnt++)
  35. {P1=LED4[cnt];
  36. delay(200);}
  37. //=========
  38. for(cnt=0;cnt<8;cnt++)
  39. {P1=LED5[cnt];
  40. delay(200);}
  41.     }
  42. }
復(fù)制代碼



分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩

相關(guān)帖子

回復(fù)

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規(guī)則

手機版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機教程網(wǎng)

快速回復(fù) 返回頂部 返回列表