標(biāo)題: Proteus仿真單片機(jī)8×8LED點(diǎn)陣屏顯示數(shù)字源程序 [打印本頁]

作者: ;▉韥韥    時(shí)間: 2022-4-25 15:12
標(biāo)題: Proteus仿真單片機(jī)8×8LED點(diǎn)陣屏顯示數(shù)字源程序
喜歡的可以下載
仿真原理圖如下(proteus仿真工程文件可到本帖附件中下載)


單片機(jī)源程序如下:
  1. #include <reg52.h>
  2. #include <intrins.h>
  3. #define uchar unsigned char
  4. #define uint unsigned int
  5. uchar code Table_OF_Digits[]=
  6. {
  7.         0x00,0x3e,0x41,0x41,0x41,0x3e,0x00,0x00,
  8.         0x00,0x00,0x00,0x21,0x7f,0x01,0x00,0x00,
  9.         0x00,0x27,0x45,0x45,0x45,0x39,0x00,0x00,
  10.         0x00,0x22,0x49,0x49,0x49,0x36,0x00,0x00,
  11.         0x00,0x0c,0x14,0x24,0x7f,0x04,0x00,0x00,
  12.         0x00,0x72,0x51,0x51,0x51,0x4e,0x00,0x00,
  13.         0x00,0x3e,0x49,0x49,0x49,0x26,0x00,0x00,
  14.         0x00,0x40,0x40,0x40,0x4f,0x70,0x00,0x00,
  15.         0x00,0x36,0x49,0x49,0x49,0x36,0x00,0x00,
  16.         0x00,0x32,0x49,0x49,0x49,0x3e,0x00,0x00,
  17. };
  18. uchar i=0,t=0,Num_Index = 0;

  19. void main()
  20. {
  21.         P3 = 0x80;
  22.         Num_Index = 0;
  23.         TMOD = 0x00;
  24.         TH0 = (8192-2000)/32;
  25.         TL0 = (8192-2000)%32;
  26.         TR0 = 1;
  27.         IE = 0x82;
  28.         while(1);
  29. }

  30. void LED_Screen_Display() interrupt 1
  31. {
  32.         TH0 = (8192-2000)/32;
  33.         TL0 = (8192-2000)%32;
  34.         P3 = _crol_(P3,1);
  35.         P0 = ~Table_OF_Digits[Num_Index * 8 +i];
  36.         if(++i == 8) i = 0;
  37.         if(++t == 250)
  38.         {
  39.                  t = 0x00;
  40.                 if(++Num_Index == 10) Num_Index = 0;
  41.         }
  42. }
復(fù)制代碼

51hei附件下載:
Keil2代碼與Proteus7.5仿真下載(注意版本一定要是Keil2和Proteus7.5):
36 8×8LED點(diǎn)陣屏顯示數(shù)字.zip (31.15 KB, 下載次數(shù): 39)






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