找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 4196|回复: 0
打印 上一主题 下一主题
收起左侧

8*8LED点阵屏显示数字 源码和仿真图提供学习

[复制链接]
跳转到指定楼层
楼主

//8*8LED点阵屏显示数字 源码和仿真图提供学习

#include <reg52.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;
    }
}
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 顶 踩
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表