標題: 單片機+74hc573實現(xiàn)全部與任意數(shù)碼管亮0~9任意數(shù)的仿真+源碼 [打印本頁]

作者: 沙與雨    時間: 2018-10-18 19:14
標題: 單片機+74hc573實現(xiàn)全部與任意數(shù)碼管亮0~9任意數(shù)的仿真+源碼
1、畫74hc573圖和實驗板數(shù)碼管圖
2、編程實現(xiàn)控制573:
1)全部數(shù)碼管亮0~9任意數(shù)
2)任意數(shù)碼管亮0~9任意數(shù)
3)第一個數(shù)碼管0~9間隔1秒循環(huán)亮
3、發(fā)揮題
第一個數(shù)碼管亮1,第二個數(shù)碼管亮2,第三個數(shù)碼管亮3,
第四個數(shù)碼管亮4,第五個數(shù)碼管亮5,第六個數(shù)碼管亮6,

仿真原理圖如下(proteus仿真工程文件可到本帖附件中下載)

單片機源程序如下:
  1. #include<reg52.h>
  2. sbit dula=P2^6;
  3. sbit wela=P2^7;
  4. void delayms(unsigned int xms){
  5. unsigned int i,j;
  6. for(i=xms;i>0;i--)
  7. for(j=110;j>0;j--);}
  8. unsigned char code table[]={
  9. ~0x3f,~0x06,~0x5b};

  10. void main(){
  11. dula=0;wela=0;

  12. while(1){
  13. P0=0x00; wela=1;wela=0;
  14. P0=~0x3f; dula=1;dula=0;
  15. P0=0x01; wela=1;wela=0;
  16. delayms(10);
  17. P0=0x00; wela=1;wela=0;
  18. P0=~0x06;dula=1;dula=0;
  19. P0=0x02; wela=1;wela=0;
  20. delayms(10);
  21. P0=0x00; wela=1;wela=0;
  22. P0=~0x5b; dula=1;dula=0;
  23. P0=0x04; wela=1;wela=0;
  24. delayms(10);

  25. }


  26. }

復制代碼

所有資料51hei提供下載:
單片機第四周作業(yè).zip (17.17 KB, 下載次數(shù): 87)






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