标题:我在做毕业设计,题目数显装置系统设计。基于AT89C51的,LED数码管显示。大 ...
只看楼主
三生石上约定
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2010-4-10
 问题点数:0 回复次数:3 
我在做毕业设计,题目数显装置系统设计。基于AT89C51的,LED数码管显示。大家有相关资料帮忙回一个。谢谢!
谢谢了  帮忙一下!
搜索更多相关主题的帖子: 设计 毕业 LED数码管 资料 
2010-04-10 11:48
lhysun_wolf
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2010-9-15
得分:0 
#include <reg52.h>                                                                  
#include <intrins.h>
#define uint unsigned int
#define uchar unsigned char
uchar temp,a,b,c,d,e,bai,shi,ge,flag,flag1;
uint shu;
sbit H1=P2^0;
sbit H2=P2^1;
sbit H3=P2^2;
sbit H4=P2^3;
sbit H5=P2^4;
sbit H6=P2^5;
void init()    ;
void display(uchar c,uchar d,uchar e,uchar bai,uchar shi,uchar ge);
uchar code table[]={0xc0,0xf9,0xa4,0xb0

,0x99,0x92,0x82,0xf8,0x80,0x90,0x88,0x83,0xc6,0xa1,0x86,0x8e,0x89,0x86,0xc7,0xc0,0};
void delay(uint z);
void main()
{
     
     init();
     while(1)
        {
            if(flag1!=1)
            
                display(7,6,5,bai,shi,ge);
            
            else
            
                display(16,17,18,18,19,20);

        }
}

void init()
{

     shu=432;
     temp=0xfe;
     P0=temp;
     TMOD=0X11;
     TH0=(65536-50000)/256;
     TL0=(65536-50000)%256;
     TH1=(65536-50000)/256;
     TL1=(65536-50000)%256;
     EA=1;
     ET0=1;
     ET1=1;
     TR0=1;
     TR1=1;
}
void time0() interrupt 1
{
     TH0=(65536-50000)/256;
     TL0=(65536-50000)%256;
     a++;
     if(flag!=1)
         {if(a==10)
             a=0;
             temp=_crol_(temp,1);
             P1=temp;
          }
      else
          {
               if(a%6==0)
               P1=~P1;
              if(a==60)
               {
                   TR0=0;
                   P1=0Xff;         
                   flag1=1;
                }
         
          }
   
}
  void time1() interrupt 3
{
     TH1=(65536-50000)/256;
     TL1=(65536-50000)%256;
     b++;
     if(b==2)
        b=0;
        shu--;
        bai=shu/100;
        shi=shu%100/10;
        ge=shu%10;
        
        if(shu==398)
           {    TR0=0;
                TH0=(65536-50000)/256;
                TL0=(65536-50000)%256;
                TR0=1;
                flag=1;
                a=0;
                P1=0xff;
                TR1=0;

           }

}
void display(uchar c,uchar d,uchar e,uchar bai,uchar shi,uchar ge)
{
     H1=0;
     P0=table[c];
     delay(1);
     H1=1;

     H2=0;
     P0=table[d];
     delay(1);
     H2=1;

     H3=0;
     P0=table[e];
     delay(1);
     H3=1;

     H4=0;
     P0=table[bai];
     delay(1);
     H4=1;

     H5=0;
     P0=table[shi];
     delay(1);
     H5=1;

     H6=0;
     P0=table[ge];
     delay(1);
     H6=1;




}
void delay(uint z)
{
     uint x,y;
     for(x=z;x>0;x--)
        for(y=110;y>0;y--);
}
2010-09-29 22:14
lhysun_wolf
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2010-9-15
得分:0 
你可以实现下
2010-09-29 22:15
软编小虫
Rank: 5Rank: 5
来 自:广西,南宁,马山
等 级:职业侠客
威 望:1
帖 子:160
专家分:324
注 册:2008-10-8
得分:0 
毕业设计?LED显示?有我也不给,都快毕业了,这个还要请人写资料!
那我只能断言,写给你你也看不懂。
2010-09-29 23:29



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-302408-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.424366 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved