单片机点阵原理图PCB图程序

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

点阵程序,动态显示“生日快乐TO meixiu from xiaoxue”

#include

#define uchar unsigned char

unsigned char code tab[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f,};//定义扫描列

unsigned char code digittab[]={

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//开始8

0x84,0x8b,0x8a,0xff,0x8a,0x8a,0x82, //生7

0x00,0x00,0xff,0x89,0x89,0x89,0xff, //日7

0x00,0x00,0x04,0xff,0x08,0x8a,0x3f,0x2a,0x4e, 0x88,//快(10)

0x00,0x00,0x08,0x48,0x2f,0x49,0xff,0x09,0x29, 0x48,//乐(10)

0x00,0x00,0x02,0x02,0xfe,0x02,0x02,0xf0,0x90,0xf0,//TO 10

0x00,0x00,0x00,0xfe,0x04,0x08,0x04,0xfe,0x00,0xf8,0xa8,0xb8,0x00,0xf4,/ 13

0x00,0x00,0x00,0x88,0x50,0x20,0x50,0x88,0x00,0xf4,0x00,0xf0,0x80,0xf0,//mei 13

0x00,0x00,0x00,0xfe,0x0a,0x0a,0x02,0xf8,0x10,0x08,0xf0,0x90,0xf0,0x00,0xf0,0x20,0xf0,//xiu From 16

0x00,0x00,0x00,0x88,0x50,0x20,0x50,0x88,0x00,0xf4,0x00,0xf0,0x90,0x90,0x70,0x80,0xf0,0x90,0xf0,//Xiao 18

0x00,0x00,0x00,0x88,0x50,0x20,0x50,0x88,0x00,0xf0,0x80,0xf0,0x00,0xf8,0xa8,0xb8,0x00,0x00,0x00,0x00,//xue 16 0xdf,0xdf,0xdf,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//!

};//要显示的字符

void delay(int t)

{

int i;

for(i=1;i<=t;i++);

}//延时函数

void main(void)

{

int a,b,c;

while(1)

{

for(a=0;a<139;a++) //所有要显示的列数

{

for(b=0;b<16;b++)//控制移动速度

{

P1=0xfe; //最右边的列先显示,程序定义向左移动

for(c=0;c<9;c++)//稍加修改可以变成向右移动

{ //例中P2接LED点阵阳极,P0接阴极

P0=digittab[a+c];//同时显示8列

delay(100);

P0=0x00; //禁止扫描列变换时,其它列亮!

P1=tab[c];

}

}

}

}

}

相关文档
最新文档