const unsigned char hz_code[20][32]= //汉字的字模数据 { { 0x18,0x00,0x1B,0xFF,0x1B,0x00,0xFF,0x00,0x1B,0xFE,0x1F,0x00,0x1F,0xFF,0x1B,0xE0, 0x3B,0xF6,0xFB,0xF7,0x1B,0xDC,0x1B,0xCC,0x1E,0xCC,0x1E,0xF7,0x7C,0xE6,0x30,0xC0},/*"振",0*/ { 0x01,0x80,0x01,0x86,0xFF,0xFF,0x01,0x80,0x03,0x00,0x3F,0xFE,0x36,0x36,0x33,0x66, 0x3F,0xFE,0x31,0x86,0x3F,0xFE,0x31,0x86,0x31,0x86,0x31,0x9E,0x31,0x8C,0x00,0x00},/*"南",1*/ { 0x01,0x80,0x01,0x80,0x01,0x80,0x3F,0xFC,0x31,0x8C,0x31,0x8C,0x3F,0xFC,0x31,0x8C, 0x31,0x8C,0x31,0x8C,0x3F,0xFC,0x31,0x8C,0x01,0x83,0x01,0x83,0x00,0xFF,0x00,0x00},/*"电",2*/ { 0x00,0x00,0x3F,0xF8,0x00,0x30,0x00,0x60,0x00,0xC0,0x01,0x80,0x01,0x80,0x01,0x86, 0xFF,0xFF,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x07,0x80,0x03,0x00},/*"子",3*/ { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x38,0x00,0x18,0x00,0x30,0x00,0x00,0x00},/*",",4*/ { 0x00,0x00,0x3F,0xFE,0x31,0xC0,0x31,0x80,0x37,0xF8,0x36,0x18,0x37,0xF8,0x36,0x18, 0x36,0x18,0x37,0xF8,0x30,0xC0,0x36,0xF0,0x67,0xDC,0x6C,0xCE,0xDB,0xCC,0xC1,0x80},/*"原",5*/ { 0x0C,0x03,0x0C,0x03,0x1E,0x1B,0x1B,0x9B,0x31,0xFB,0x60,0xDB,0xFF,0x9B,0x31,0x9B, 0x31,0x9B,0x37,0x9B,0x33,0x1B,0x30,0xC3,0x30,0xC3,0x30,0xCF,0x1F,0xC6,0x00,0x00},/*"创",6*/ { 0x00,0x00,0x3F,0xFE,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x7F,0xFF,0x01,0xC0, 0x03,0xC0,0x03,0xC0,0x06,0xC0,0x0C,0xC0,0x18,0xC3,0x30,0xC3,0xE0,0x7F,0x00,0x00},/*"无",7*/ { 0x00,0x00,0xFF,0xFC,0xDB,0x0C,0xDB,0xFC,0xF3,0x0C,0xF3,0x0C,0xDB,0xFC,0xCF,0xC0, 0xCF,0x6C,0xFF,0x78,0xDB,0x30,0xC3,0x30,0xC3,0x18,0xC3,0xCF,0xC3,0x86,0xC3,0x00},/*"限",8*/ { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00, 0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x00,0x00,0x18,0x00,0x00,0x00},/*"!",9*/ { 0x01,0x80,0x01,0x80,0x01,0xFC,0x01,0x80,0x01,0x98,0x1F,0xFC,0x18,0x18,0x18,0x18, 0x18,0x18,0x1F,0xF8,0x18,0x18,0x01,0x98,0x3C,0xCC,0x36,0x66,0x66,0x66,0x00,0x00},/*"点",10*/ { 0x00,0xC0,0xFC,0xC0,0xCC,0xC0,0xDF,0xFE,0xF1,0x80,0xD9,0xE0,0xCF,0x60,0xCF,0xFE, 0xCC,0x60,0xFC,0x60,0xDF,0xFF,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60},/*"阵",11*/ { 0x3F,0xFE,0x30,0x06,0x30,0x06,0x3F,0xFE,0x36,0x18,0x33,0x30,0x3F,0xFE,0x33,0x30, 0x33,0x30,0x3F,0xFF,0x33,0x30,0x33,0x30,0x66,0x30,0x66,0x30,0xCC,0x30,0x18,0x30},/*"屏",12*/ { 0x60,0xC0,0x30,0x60,0x3F,0xFF,0x01,0xB0,0xC3,0x1C,0x66,0xCC,0x79,0xB0,0x1B,0xF8, 0x18,0xD8,0x31,0xCC,0x33,0x78,0xF7,0x30,0x3F,0x18,0x33,0xCC,0x33,0x8F,0x33,0x06},/*"滚",13*/ { 0x00,0x30,0x00,0x30,0x7F,0x30,0x00,0x30,0x00,0xFE,0xFF,0xB6,0x18,0x36,0x18,0x36, 0x36,0x36,0x33,0x36,0x6F,0xE6,0xFF,0x66,0x60,0xC6,0x01,0x9E,0x03,0x0C,0x00,0x00},/*"动",14*/ { 0x00,0x00,0x1F,0xF8,0x18,0x18,0x1F,0xF8,0x18,0x18,0x1F,0xF8,0x06,0x60,0x06,0x60, 0x66,0x6C,0x36,0x6C,0x1E,0x78,0x1E,0x70,0x06,0x60,0xFF,0xFF,0x00,0x00,0x00,0x00},/*"显",15*/ { 0x00,0x00,0x1F,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0x01,0x80,0x01,0x80, 0x19,0xB0,0x19,0x98,0x31,0x8C,0x61,0x8E,0xC1,0x86,0x01,0x80,0x07,0x80,0x03,0x00},/*"示",16*/ { 0x01,0x80,0x00,0xC0,0x3F,0xFF,0x3C,0x06,0x67,0xCC,0x06,0xC0,0x0C,0xC0,0x07,0xC0, 0x06,0xC0,0x7F,0xFF,0x00,0xC0,0x01,0xE0,0x03,0x30,0x06,0x18,0x1C,0x1C,0x70,0x18},/*"实",17*/ { 0x00,0x00,0xFC,0x60,0x0C,0x60,0x6C,0xF0,0x6C,0xD8,0x6D,0x8F,0x6F,0xF8,0x7E,0x00, 0x06,0xC6,0x07,0x66,0x3F,0xEC,0xE7,0xEC,0x06,0x18,0x1F,0xFF,0x0C,0x00,0x00,0x00},/*"验",18*/ { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x86, 0x60,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"~",19*/ };
unsigned char dz_buf1[16][2];
int main(void) { unsigned int index=0,i=0;
ZNX_Board_Init(); //ZN-X开发板的板级初始化
delay_init(); //延时函数初始化 uart_init(38400);
printf("******************************* \r\n"); printf("This is LedMatrix Rolling Test \r\n"); printf("******************************* \r\n");
DZ_Init(); //初始化点阵,启动点阵动态扫描
while(1) { DZ_Make_Rolling_Data(dz_buf1,hz_code[index],i++);
DZ_UpdateBuffer((unsigned char *)dz_buf1); //将汉字的字模数据更新到显示缓冲数组中
if(i==16) {i=0;index++;index%=20;}
delay_ms(30); } } |