仿真软件中如何用8x8LED点阵显示数字?

 我来答
H121508
推荐于2016-01-19 · TA获得超过3266个赞
知道小有建树答主
回答量:1393
采纳率:33%
帮助的人:1219万
展开全部

8x8LED点阵显示数字

#include<reg51.h>

#include<intrins.h>

#define uchar unsigned char

#define uint unsigned int

uchar code Table_OF_Digits[]=

{

 0x00,0x3E,0x41,0x41,0x41,0x3E,0x00,0x00,

 0x00,0x00,0x00,0x21,0x7F,0x01,0x00,0x00,

 0x00,0x27,0x45,0x45,0x45,0x39,0x00,0x00,

 0x00,0x22,0x49,0x49,0x49,0x36,0x00,0x00,

 0x00,0x0C,0x14,0x24,0x7F,0x04,0x00,0x00,

 0x00,0x72,0x51,0x51,0x51,0x4E,0x00,0x00,

 0x00,0x3E,0x49,0x49,0x49,0x26,0x00,0x00,

 0x00,0x40,0x40,0x40,0x4F,0x70,0x00,0x00,

 0x00,0x36,0x49,0x49,0x49,0x36,0x00,0x00,

 0x00,0x32,0x49,0x49,0x49,0x3E,0x00,0x00,

};

uchar i=0,t=0,Num_Index=0;

void main()

{

 P3=0x80;

 Num_Index=0;

 TMOD=0x00;

 TH0=(8192-2000)/32;

 TL0=(8192-2000)%32;

 TR0=1;

 IE=0x82;

 while(1);

}

void LED_Screen_Display() interrupt 1

{

 TH0=(8192-2000)/32;

 TL0=(8192-2000)%32;

 P3=_crol_(P3,1);

 P0=~Table_OF_Digits[Num_Index*8+i];

 if(++i==8)

 i=0;

 if(++t==250)

  {

   t=0x00;

       if(++Num_Index==10)

       Num_Index=0;

  }

}

推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式