標(biāo)題: 51單片機(jī)八位LED數(shù)碼管動態(tài)掃描顯示程序與Proteus仿真圖 [打印本頁]

作者: Jaden_chen    時間: 2021-10-9 15:57
標(biāo)題: 51單片機(jī)八位LED數(shù)碼管動態(tài)掃描顯示程序與Proteus仿真圖
這是我最近做的八位LED顯示的工程
  1. #include<reg52.h>
  2. #include<intrins.h>
  3. #define uint unsigned int
  4. #define uchar unsigned char
  5. delay(ms)
  6. {
  7. while(ms--)
  8. {int i;
  9. for(i=0; i<110; i++);}
  10. }
  11. void main(){
  12. uchar
  13. a[16]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x88,0x83,0xc6,0xal,0x86,0x8e };
  14. uchar b[8]={0x08,0x07,0x02,0x0a,0x0f,0x06,0x03,0x05},j;
  15. uint i ;
  16. while(1)  {
  17. j=0x01 ;
  18. for( i=0; i<8;i++){
  19. P2=j;
  20. P0=a[b[i]];j=_crol_( j,1);
  21. delay(3);}
  22. }}
復(fù)制代碼


51hei.png (14.58 KB, 下載次數(shù): 111)

51hei.png

任務(wù)七.rar

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


作者: 裝睡的人叫不醒    時間: 2022-12-7 10:40
上面那個藍(lán)色的是啥




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