微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > 51单片机程序——点阵字体移动显示

51单片机程序——点阵字体移动显示

时间:11-23 来源:互联网 点击:
#include

#define uint unsigned int

unsigned char code tab[]={0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe};

unsigned char code dian[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};

unsigned char code dian0[]={0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00};

unsigned char code dian1[]={0x01,0x01,0x01,0x03,0x01,0x01,0x01,0x00};

unsigned char code dian2[]={0x03,0x02,0x02,0x07,0x02,0x02,0x03,0x00};

unsigned char code dian3[]={0x07,0x05,0x05,0x0f,0x05,0x05,0x07,0x00};

unsigned char code dian4[]={0x0f,0x0a,0x0a,0x1f,0x0a,0x0a,0x0f,0x00};

unsigned char code dian5[]={0x1f,0x15,0x15,0x3f,0x15,0x15,0x1f,0x00};

unsigned char code dian6[]={0x3e,0x2a,0x2a,0x7f,0x2a,0x2a,0x3e,0x00};

unsigned char code dian7[]={0x7c,0x54,0x54,0xff,0x55,0x55,0x7d,0x01};

unsigned char code zhi[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};

unsigned char code zhi0[]={0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01};

unsigned char code zhi1[]={0x00,0x02,0x02,0x02,0x02,0x03,0x03,0x02};

unsigned char code zhi2[]={0x00,0x04,0x04,0x04,0x05,0x06,0x06,0x04};

unsigned char code zhi3[]={0x01,0x09,0x09,0x09,0x0b,0x0d,0x0d,0x09};

unsigned char code zhi4[]={0x02,0x12,0x12,0x12,0x17,0x1a,0x1a,0x12};

unsigned char code zhi5[]={0x04,0x24,0x24,0x24,0x2f,0x34,0x34,0x24};

unsigned char code zhi6[]={0x08,0x48,0x48,0x48,0x5f,0x68,0x68,0x48};

unsigned char code zhi7[]={0x10,0x90,0x91,0x91,0xbf,0xd0,0xd0,0x90};

unsigned char code she[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};

unsigned char code she0[]={0x01,0x00,0x00,0x01,0x01,0x01,0x01,0x00};

unsigned char code she1[]={0x02,0x01,0x00,0x03,0x02,0x02,0x03,0x00};

unsigned char code she2[]={0x04,0x02,0x01,0x06,0x04,0x04,0x06,0x01};

unsigned char code she3[]={0x09,0x05,0x02,0x0d,0x09,0x09,0x0d,0x02};

unsigned char code she4[]={0x12,0x0b,0x04,0x1b,0x12,0x12,0x1b,0x04};

unsigned char code she5[]={0x24,0x17,0x08,0x36,0x25,0x25,0x36,0x08};

unsigned char code she6[]={0x48,0x2f,0x11,0x6c,0x4b,0x4b,0x6c,0x10};

unsigned char code she7[]={0x90,0x5f,0x22,0xd9,0x96,0x96,0xd9,0x20};

unsigned char code ji[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};

unsigned char code ji0[]={0x01,0x00,0x00,0x00,0x00,0x01,0x00,0x00};

unsigned char code ji1[]={0x02,0x01,0x00,0x00,0x00,0x03,0x00,0x00};

unsigned char code ji2[]={0x04,0x02,0x00,0x00,0x00,0x07,0x00,0x00};

unsigned char code ji3[]={0x09,0x05,0x00,0x01,0x01,0x0f,0x01,0x01};

unsigned char code ji4[]={0x12,0x0b,0x00,0x02,0x02,0x1f,0x02,0x02};

unsigned char code ji5[]={0x24,0x17,0x00,0x04,0x04,0x3f,0x04,0x04};

unsigned char code ji6[]={0x48,0x2f,0x01,0x08,0x08,0x7f,0x08,0x08};

unsigned char code ji7[]={0x90,0x5f,0x02,0x10,0x10,0xff,0x10,0x10};

void delay(uint z)

{

uint x,y;

for(x=z;x>0;x--)

for(y=110;y>0;y--);

}

void main()

{

int i,t=25;

while(1)

{

while(t--)

{

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

{

P0=tab[i];

P1=dian[i];

delay(5);

}

}

t=25;

while(t--)

{

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

{

P0=tab[i];

P1=dian0[i];

delay(5);

}

}

t=25;

while(t--)

{

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

{

P0=tab[i];

P1=dian1[i];

delay(5);

}

}

t=25;

while(t--)

{

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

{

P0=tab[i];

P1=dian2[i];

delay(5);

}

}

t=25;

while(t--)

{

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

{

P0=tab[i];

P1=dian3[i];

delay(5);

}

}

t=25;

while(t--)

{

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

{

P0=tab[i];

P1=dian4[i];

delay(5);

}

}

t=25;

while(t--)

{

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

{

P0=tab[i];

P1=dian5[i];

delay(5);

}

}

t=25;

while(t--)

{

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

{

P0=tab[i];

P1=dian6[i];

delay(5);

}

}

t=25;

while(t--)

{

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

{

P0=tab[i];

P1=dian7[i];

delay(5);

}

}

t=25;

while(t--)

{

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

{

P0=tab[i];

P1=zhi[i];

delay(5);

}

}

t=25;

while(t--)

{

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

{

P0=tab[i];

P1=zhi0[i];

delay(5);

}

}

t=25;

while(t--)

{

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

{

P0=tab[i];

P1=zhi1[i];

delay(5);

}

}

t=25;

while(t--)

{

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

{

P0=tab[i];

P1=zhi2[i];

delay(5);

}

}

t=25;

while(t--)

{

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

{

P0=tab[i];

P1=zhi3[i];

delay(5);

}

}

t=25;

while(t--)

{

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

{

P0=tab[i];

P1=zhi4[i];

delay(5);

}

}

t=25;

while(t--)

{

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

{

P0=tab[i

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top