1、efan 23:04:26有对汉字 LED 点阵显示熟悉的朋友吗? 要下雨了 23:04:51什么问题 typhoon 23:04:54恩 efan 23:05:11有段程序看不太懂 efan 23:05:26#include #define int8 unsigned char#define int16 unsigned int#define int32 unsigned longint8 flag;int8 n;int8 code table32=0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x
2、00,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,/*“欢“,0*/0x02,0x02,0x04,0x82,0xF8,0x73,0x04,
3、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,/*“迎“,1*/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/*“ “ *
4、/;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=while (1)for (i=0;i1100)offset=0;n=0; efan 23:05:57程序有两个地方不太明白1. P0=*(p+offset+2*i);为什么要乘以 2,原理是什么?2.void timer0() interrupt 1 using 3这个中断是为了产生 offset 的原理是什么,为什么能实现汉字的移动显示 (从右至左
5、) efan 23:07:31这段程序实现汉字从左到右滚动显示 狂人 23:07:381 16*16 的点阵2 每扫一次偏移地址加 2efan(6939780) 23:08:35能具体一点吗? efan(6939780) 23:09:221。里面还加了个 offset, 为什么能实现跑马显示 狂人(63637313) 23:09:23每行 16 个 led,当然要用 2 个字节,这个明白吧 efan(6939780) 23:09:38这个懂了 狂人(63637313) 23:10:33中断一次,数据整体下移一行,有问题吗? efan(6939780) 23:10:51我想想。 。 。efan(
6、6939780) 23:12:23不理解,是不是指 offset+=2? 要下雨了(422583941) 23:12:58是吧 狂人(63637313) 23:13:11我没仔细看 太长了你明白了原理再看程序就简单了 efan(6939780) 23:13:39他是左跑马,为何下移动阿? 狂人(63637313) 23:14:09我随便说的 efan(6939780) 23:14:18狂人(63637313) 23:14:58要下雨了(422583941) 23:15:00向左跑 就是说逐步去掉左边的一些代码不要 要下雨了(422583941) 23:15:44第一列的数据逐步往右边取efan
7、(6939780) 23:17:17对照汉字码看一下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,/*“欢“,0*/起始为 0x04,0x28中断一次,跳到哪个了?是不是 0x08,0x24? 要下雨了(422583941) 23:17:38是的要下雨了(422583941) 23:17:51第一列就显示了 0x08,0x24要下雨了(422583941) 23:18:18你这个程序运行对了没有efan(6939780) 23:19:03跑了,proteus 没问题 要下雨了(422583941) 23:19:12哦要下雨了(422583941) 23:19:12哦 要下雨了(422583941) 23:19:36明白了吗狂人(63637313) 23:20:18你单步跑下就更清楚了 efan(6939780) 23:20:20程序还有点点不明白,原理晓得了efan(6939780) 23:38:59我说一下算了,电路很简单,p0 口发汉字码,p1 口输出扫描码