51单片机16×16点阵(滚动显示)

发布者:闪耀星空最新更新时间:2015-08-26 来源: eefocus关键字:51单片机  16×16点阵  滚动显示 手机看文章 扫描二维码
随时随地手机看文章
#include

 

typedef unsigned char int8 ;

typedef unsigned int int16 ;

typeded unsigned long int32 ;

 

int8 flag;

int8 n;

int8 code table[][32]={

{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},

 

 

{0x04,0x28,0x08,0x24,0x32,0x22,0xC2,0x21,0xC2,0x26,0x34,0x38,0x04,0x04,0x08,0x18,0x30,0xF0,0xC0,0x17,0x60,0x10,0x18,0x10,0x0C,0x14,0x06,0x18,0x04,0x10,0x00,0x00},

{0x02,0x02,0x04,0x82,0xF8,0x73,0x04,0x20,0x02,0x00,0xE2,0x3F,0x42,0x20,0x82,0x40,0x02,0x40,0xFA,0x3F,0x02,0x20,0x42,0x20,0x22,0x20,0xC2,0x3F,0x02,0x00,0x00,0x00},

{0x00,0x01,0x04,0x02,0x1C,0x0C,0xC0,0x3F,0x1C,0xC0,0x02,0x09,0x02,0x16,0x92,0x60,0x4A,0x20,0x82,0x2F,0x02,0x20,0x0E,0x24,0x00,0x22,0x90,0x31,0x0C,0x20,0x00,0x00},

{0x44,0x10,0x44,0x14,0x88,0x54,0x88,0x54,0xD0,0x5F,0x30,0x50,0x60,0x50,0xFE,0x7F,0x40,0x50,0x20,0x90,0xB0,0x9F,0x98,0x92,0x8C,0x94,0x88,0x34,0x80,0x11,0x00,0x00},

{0x82,0x00,0x02,0x01,0x22,0x06,0x22,0x38,0x22,0x04,0x22,0x03,0x22,0x00,0xFE,0xFF,0xA2,0x00,0x22,0x01,0x22,0x02,0x22,0x3C,0x22,0x02,0x02,0x01,0x02,0x00,0x00,0x00},

{0x02,0x00,0x0C,0x00,0xF0,0x3F,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0xA0,0x00,0x60,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x00},

{0x80,0x00,0x01,0x07,0x06,0x00,0x18,0x00,0xE0,0xFF,0x00,0x04,0x00,0x03,0x00,0x00,0xFE,0x7F,0x00,0x08,0x00,0x06,0x80,0x01,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00},

{0x00,0x00,0x04,0x20,0x04,0x21,0x04,0x21,0x04,0x21,0x04,0x21,0x04,0x21,0x04,0x21,0x04,0x21,0x04,0x21,0x04,0x21,0x04,0x21,0x04,0x21,0x04,0x20,0x04,0x00,0x00,0x00},

{0x20,0x08,0x20,0x86,0x7F,0x60,0x80,0x0F,0x00,0x04,0x00,0x1A,0x00,0xEA,0x00,0x2A,0x00,0x2A,0x00,0x2A,0x00,0x2A,0xF0,0x2B,0x0C,0x28,0x02,0x20,0x0F,0x00,0x00,0x00},

{0x00,0x00,0x80,0x00,0x04,0x01,0x0E,0x02,0x14,0x0C,0x24,0x70,0xC4,0x21,0x8C,0x00,0x08,0x00,0x08,0x70,0x28,0x08,0x1E,0x06,0x0C,0x03,0x80,0x01,0x00,0x01,0x00,0x00},

{0x00,0x00,0x00,0x08,0xF8,0x49,0x20,0x49,0x20,0x49,0x20,0x49,0x20,0x49,0x20,0x49,0x20,0x49,0xF0,0x49,0x00,0x48,0x04,0x40,0x02,0x40,0xFC,0x7F,0x00,0x00,0x00,0x00},

{0x00,0x00,0x80,0x00,0x04,0x01,0x0E,0x02,0x14,0x0C,0x24,0x70,0xC4,0x21,0x8C,0x00,0x08,0x00,0x08,0x70,0x28,0x08,0x1E,0x06,0x0C,0x03,0x80,0x01,0x00,0x01,0x00,0x00},

{0x40,0x00,0x40,0x08,0x41,0x08,0x42,0x08,0x4C,0x08,0xF8,0x7F,0x50,0x08,0x40,0x08,0x40,0x08,0x60,0x08,0xD0,0x7F,0x4C,0x08,0x47,0x08,0x42,0x08,0x40,0x00,0x00,0x00},

{0x20,0x08,0x20,0x86,0x7F,0x60,0x80,0x0F,0x00,0x04,0x00,0x1A,0x00,0xEA,0x00,0x2A,0x00,0x2A,0x00,0x2A,0x00,0x2A,0xF0,0x2B,0x0C,0x28,0x02,0x20,0x0F,0x00,0x00,0x00},

{0x20,0x00,0x20,0x20,0x20,0x21,0x20,0x23,0x20,0x25,0x20,0x39,0x20,0xE1,0x20,0x21,0xFF,0x2F,0x20,0x21,0x20,0x21,0x20,0x21,0x20,0x21,0x20,0x21,0x20,0x00,0x00,0x00},

{0x00,0x00,0x00,0x00,0x1A,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},

{0x00,0x04,0x01,0x04,0x02,0x04,0x04,0x04,0x08,0x04,0x30,0x04,0xC0,0x05,0x00,0xFE,0x80,0x05,0x60,0x04,0x10,0x04,0x0C,0x04,0x06,0x04,0x03,0x04,0x02,0x04,0x00,0x00},

{0x00,0x02,0x40,0x0C,0x40,0x08,0x40,0x48,0x40,0x3A,0x40,0x2A,0x42,0x0A,0x41,0x8A,0xFE,0x7A,0x40,0x2B,0x40,0x0A,0x40,0x18,0x40,0xEA,0x40,0x4C,0x40,0x08,0x00,0x00},

{0x20,0x08,0x30,0x08,0xE0,0xFF,0x42,0x08,0x4C,0x08,0xF0,0x1F,0x10,0x12,0x1A,0x12,0xF2,0x13,0x04,0x10,0xC8,0xFF,0x30,0x10,0xCC,0x50,0x02,0x37,0x1C,0x12,0x00,0x00},

{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x0E,0x14,0x10,0x24,0x10,0x44,0x10,0x84,0x11,0x0C,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},

{0x04,0x02,0x44,0x06,0xC4,0x1A,0x48,0xE3,0x48,0x46,0x48,0x00,0x04,0x09,0x04,0x09,0x08,0x09,0xC8,0xFF,0x30,0x09,0x28,0x49,0x44,0x39,0x02,0x29,0x1F,0x01,0x00,0x00},

{0x00,0x02,0x02,0x42,0x04,0x42,0x08,0x42,0x30,0x42,0xC0,0x7F,0x00,0x42,0x00,0x42,0x00,0x42,0x00,0x42,0xFE,0x7F,0x00,0x42,0x00,0x42,0x00,0x42,0x00,0x42,0x00,0x00},

{0x40,0x04,0x80,0x08,0x00,0x11,0xFF,0xEF,0x00,0x44,0x02,0x10,0x82,0x10,0x82,0x10,0x82,0x90,0xFE,0x7F,0x82,0x50,0x82,0x10,0x82,0x10,0x82,0x10,0x02,0x10,0x00,0x00},

{0x00,0x04,0x01,0x04,0x02,0x04,0x04,0x04,0x08,0x04,0x30,0x04,0xC0,0x05,0x00,0xFE,0x80,0x05,0x60,0x04,0x10,0x04,0x0C,0x04,0x06,0x04,0x03,0x04,0x02,0x04,0x00,0x00},

{0x00,0x02,0x40,0x0C,0x40,0x08,0x40,0x48,0x40,0x3A,0x40,0x2A,0x42,0x0A,0x41,0x8A,0xFE,0x7A,0x40,0x2B,0x40,0x0A,0x40,0x18,0x40,0xEA,0x40,0x4C,0x40,0x08,0x00,0x00},

{0x20,0x08,0x30,0x08,0xE0,0xFF,0x42,0x08,0x4C,0x08,0xF0,0x1F,0x10,0x12,0x1A,0x12,0xF2,0x13,0x04,0x10,0xC8,0xFF,0x30,0x10,0xCC,0x50,0x02,0x37,0x1C,0x12,0x00,0x00},

{0x00,0x00,0x00,0x00,0x1A,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},

{0x00,0x02,0x00,0x42,0x00,0x32,0xFE,0x23,0x04,0x00,0x08,0x44,0xFF,0x55,0x50,0x55,0x50,0x55,0x50,0xFD,0x52,0x55,0x51,0x55,0xFE,0x55,0x00,0x44,0x00,0x04,0x00,0x00},

{0x00,0x01,0x04,0x02,0x1C,0x0C,0xC0,0x3F,0x1C,0xC0,0x02,0x09,0x02,0x16,0x92,0x60,0x4A,0x20,0x82,0x2F,0x02,0x20,0x0E,0x24,0x00,0x22,0x90,0x31,0x0C,0x20,0x00,0x00},

{0x82,0x00,0x02,0x01,0x22,0x06,0x22,0x38,0x22,0x04,0x22,0x03,0x22,0x00,0xFE,0xFF,0xA2,0x00,0x22,0x01,0x22,0x02,0x22,0x3C,0x22,0x02,0x02,0x01,0x02,0x00,0x00,0x00},

{0x01,0x08,0xC2,0x08,0x44,0x0F,0x28,0xF8,0x30,0x08,0xCE,0x0F,0x04,0x01,0x00,0x41,0x02,0x41,0x01,0x41,0xFE,0x4F,0x00,0x51,0x00,0x61,0x00,0x41,0x00,0x01,0x00,0x00},

{0x42,0x08,0x81,0x08,0xFE,0xFF,0x00,0x09,0x01,0x0A,0x01,0x01,0x02,0x11,0x0C,0x11,0x30,0x11,0xC0,0xFF,0x30,0x11,0x08,0x11,0x06,0x11,0x03,0x11,0x02,0x01,0x00,0x00},

{0x20,0x08,0xC0,0x48,0x00,0x4B,0xFF,0x7F,0x00,0x89,0x9C,0x88,0x00,0x10,0xBC,0x2A,0x82,0xCA,0xC2,0x4A,0xB2,0x5A,0x82,0x6A,0xAE,0x0A,0x90,0x0F,0x0C,0x00,0x00,0x00},

{0x00,0x00,0x00,0x00,0x00,0x00,0xFA,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},

 

{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}

};

 

void delay(void);

int16 offset;

 

void main(void)

{

int8 i;

int8 *p;

flag=0x10;

n=0;

TMOD=0x01;

TH0=0xb1;

TL0=0xe0;

ET0=1;

EA=1;

TR0=1;

 

p=&table[0][0];

 

while (1)

{

for (i=0;i<8;i++) //显示左半边屏幕

{

P0=*(p+offset+2*i);

P2=i|0x08; //P2.4=0,P2.3=1 选中U2, 输出扫描码给U6

delay();

 

P0=*(p+offset+2*i+1);

P2=i|0x10; //P2.4=1,P2.3=0 选中U3, 输出扫描码给U7

delay();

}

for (i=8;i<16;i++) //显示右半边屏幕

{

P0=*(p+offset+2*i);

P2=(i-8)|0x20; //P2.5=1 P2.4=0, P2.3=0 选中U4,输出扫描码U8

delay();

 

P0=*(p+offset+2*i+1);

P2=(i-8)|0x40; //P2.6=1 P2.5=0, P2.4=0 选中U5,输出扫描码U9

delay();

}

}

}

 

 

void delay(void)

{

int16 i;

for (i=0;i<50;i++)

;

}

 

 

void timer0() interrupt 1 using 3

{

TF0=0;

TH0=0xb1;

TL0=0xe0;

if (n<10)

{

n++;

}

else

{

offset+=2;

if (offset>1100)

offset=0;

n=0;

}

}

关键字:51单片机  16×16点阵  滚动显示 引用地址:51单片机16×16点阵(滚动显示)

上一篇:51单片机教程ADC0809模数转换
下一篇:基于89C52的DH11 C语言测试程序

推荐阅读最新更新时间:2024-03-16 14:30

基于51单片机的无线信号编解码技术研究
随着微电子、计算机信息技术的迅速发展,由单片机和无线传输模块组成的无线数据通信系统在石油、电力、水文、冶金、安防等行业的无线控制、数据采集、故障报警等诸多领域中得到越来越广泛的应用。而数据的编解码对于无线传输可靠性的影响举足轻重。目前编解码方式主要有硬件编解码和软件编解码两种。本文在对已有硬件及软件编解码技术研究的基础上,设计并通过STC89C516RD+单片机实现了一种以软件方式对传输数据编解码的方法。 1 现有的编解码技术 1.1 硬件编解码技术  目前有多种用于编码和解码的专用芯片,PT2262/PT2272是比较常用的一种。在通常的使用中,一般采用8位地址码和4位数据码,这时编码芯片PT2262和解码芯片PT2272的第
[工业控制]
基于<font color='red'>51单片机</font>的无线信号编解码技术研究
51单片机上拉电阻多大
1、51单片机的p0口为了实现准3态,采用了oc输出,也就是集电极悬空输出,也有叫图腾柱输出的。这种电路结构,只有下拉能力,高电平输出没有电流,在高电平时表现为高阻态;加上上拉电阻,就会失去高阻态,变成 1、0 两态。 2、p0口上拉电阻的选择,应遵循基本的电路设计原则,不能盲目套用,要看后级情况而定: 例如,后级驱动的是1只npn三极管,这个三极管的放大倍数(β)=100倍,三极管的负载电流(ic)要求100ma,当电源为5v时: a、三极管的ib=ic/β=1ma; b、上拉电阻大约=r=5v/ib=5kω; c、为了使三极管注入ib后就迅速进入导通(开)状态,r应再小一些,如4k3; 3、由上面计算可见,三极管的负载大小、放
[单片机]
51单片机中断号与定时器的工作方式
中 断 号 interrupt 0 外部中断0(EX0) interrupt 1 定时器/计时器器中断0(ET0) interrupt 2 外部中断1 (EX1) interrupt 3 定时器/计时器器中断1(ET1) interrupt 4 串口中断(ES) 定 时 器 工 作 方 式 1.方式0 由TH0的8位和TL0的低5位组成一个13位计时器。 当13位计时器从0或设
[单片机]
<font color='red'>51单片机</font>中断号与定时器的工作方式
基于89C51单片机和CAN控制器实现老旧住宅供暖计量系统的改造设计
1、引言 CAN总线技术诞生于汽车控制领域,随着其技术的不断完善,应用领域也不断扩展。 CAN总线技术进入我国以来,在经历了引进、使用阶段后,自2000年以来,国内许多相关厂商对该总线技术进行了不懈的研究与开发,取得了一定的成果,目前,国内CAN总线技术已经在汽车控制、数控机床、医疗器械和楼宇自动化等众多领域得到了应用,是受到广泛关注的总线技术之一。 CAN总线具有现场总线的特点,适合于分布式系统的应用。目前,国内已具有一定的 CAN总线产品的开发能力,其应用成本也随之降低,所以,在传统控制系统的改造中 CAN总线技术得到了比较广泛的应用。随着热能商品化和供暖计费制度的改革,国内居民住宅供暖体制也将发生变化,其中最为重要的也是
[单片机]
基于89C<font color='red'>51单片机</font>和CAN控制器实现老旧住宅供暖计量系统的改造设计
51单片机-代码参考
前面的篇章我们都是在普及知识,真正使用好定时器还是需要重新拟定新的书写方案的,我们参考了宋老师的书写方式,在他的代码基础上我们进行小修改成就实用的工程代码。 1.代码解析 void ConfigTimer0(unsigned int ms) { unsigned long tmp; //临时变量 tmp = 11059200 / 12; //定时器计数频率 tmp = (tmp * ms) / 1000; //计算所需的计数值 tmp = 65536 - tmp; //计算定时器重载值 tmp = tmp + 13; //补偿中断响应延时造
[单片机]
51单片机I2C 24c02 1-99秒循环定时器
51单片机,I2C 24c02 1-99秒循环定时器 仿真电路。 程序源码 HEX文件 单片机源程序如下: #include reg52.h #include i2c.h #ifndef uchar #define uchar unsigned char #endif #ifndef uint #define uint unsigned int #endif #ifndef ulong #define ulong unsigned long #endif uchar stoptime=0,runtime=0,stopcoun=00,runcoun=00; uchar di
[单片机]
<font color='red'>51单片机</font>I2C 24c02 1-99秒循环定时器
基于AT89C51单片机和DDS器件实现频率特征测试仪的设计
1、 引 言 频率特性是一个系统(或元件)对不同频率正弦输入信号的响应特性。如图1所示,被测系统输入幅值为Ar、角频率为ω的正弦信号,如果该系统是线性的,则其稳态输出也是正弦信号,频率ω不变,幅值为Ac,相角差为φ。改变ω可以得到一系列输入和输出数据。输出对输入的幅值比A(ω)=Ac/Ar与ω的关系曲线称为该系统的幅频特性,通常取20 lg A(ω)称为对数幅频特性。输出对输入的相角差φ(ω)与ω的关系曲线称为该系统的相频特性。幅频特性和相频特性综合称为频率特性,常用的是系统的开环频率特性即波特图。 一个系统的频率特征可通过频率特征测试仪来测定。频率特性测试仪也称扫频仪,用于测试被测网络的幅频特性。他可以测量被测网络的谐振频
[单片机]
基于AT89C<font color='red'>51单片机</font>和DDS器件实现频率特征测试仪的设计
基于51单片机的汉字LCD智能显示模块设计
引言 在电子产品设计中,人机交互显示界面是必不可少的工作,目前一般使用的液晶显示器均为七段笔划式,只能显示数字和少量字符,功能往往受到局限,对于较复杂的字符或图形则无能为力。而LCD智能型显示模块则是一种低功耗、低损耗、低价值的显示器件,它不但可以显示各式各样的字符、汉字和图形,同时具有可编程能力,且与单片机接口方便,基于以上优点,LCD智能显示模块获得了广泛的应用。 系统组成 本系统主要由三部分组成,分别为单片机,LCD模块和FLASH字库,图1所示是该系统的硬件原理框图,由于显示所需要占用的资源过多(本设计采用的是16×16点阵,每个汉字存储需要32个字节),而单片机内部RAM资源及其有限,所以系统设计时有必要扩展—FL
[应用]
小广播
添点儿料...
无论热点新闻、行业分析、技术干货……
设计资源 培训 开发板 精华推荐

最新单片机文章
何立民专栏 单片机及嵌入式宝典

北京航空航天大学教授,20余年来致力于单片机与嵌入式系统推广工作。

换一换 更多 相关热搜器件
随便看看
电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved