//--------------------------------
//--------------------------------
//
// 16*16点阵LED显示中文程序
// 本程序逐个显示中文,从右至左流动显示
// 使用横向,流动只有字节间操作
// 字模数据:文字下侧存储为数组中奇数
// 文字上侧存储为数组中偶数
//
//--------------------------------
#i nclude
#define SEL P3 //行选线,P3 低四位
#define UP8 P0 //点阵文字上8行IO
#define DOWN8 P2 //点阵文字下8行IO
unsigned char code FontData [5][32] = {
/*-- 文字: 生 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x80,0x10,0xC0,0x10,0x80,0x10,0x88,0x1F,0xFC,0x20,0x80,0x20,0x80,0x40,0x88,
0x9F,0xFC,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x84,0x7F,0xFE,0x00,0x00
/*-- 文字: 日 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x00,0x1F,0xF0,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x1F,0xF0,0x10,0x10,
0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x1F,0xF0,0x10,0x10,0x00,0x00,0x00,0x00
/*-- 文字: 快 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x20,0x80,0x20,0x80,0x20,0x80,0x37,0xF8,0xA8,0x88,0xA8,0x88,0xA0,0x88,0x2F,0xFE,
0x20,0x80,0x21,0x40,0x21,0x40,0x21,0x20,0x22,0x10,0x22,0x18,0x24,0x0E,0x28,0x04
/*-- 文字: 乐 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x30,0x01,0xF8,0x1F,0x00,0x10,0x80,0x10,0x80,0x10,0x80,0x3F,0xFC,0x10,0x80,
0x08,0x80,0x0C,0x90,0x18,0x88,0x30,0x8C,0x24,0x86,0x42,0x84,0x01,0x00,0x00,0x00
}
};
void Delay_50us(unsigned char t) //50us延时程序
{
unsigned char j;
for(;t>0;t--)
for(j=19;j>0;j--)
;
}
void DisNFont (unsigned char *FontBufferStart,unsigned char N,unsigned char Time) //流动显示N个汉字
{ //参数三个:字符串字模首地址、字数、显示流动速度
unsigned char FontNum,i,j,row; //循环变量,字数计数、16次流动、16列扫描
for(FontNum=0;FontNum
for(i=0;i<16;i++) //字到字流动 16次左移才能完成
{
for(j=0;j
没有硬件,软件怎么写呢?
这里应该有你要的答案http://www.picavr.com/