点阵取模{0x00,0xF8,0x3F,0x00,0x04,0x00,0x08,0x20,0x10,0x40,0x3F,0x80,0x01,0x00,0x06,0x10}, {0x18,0x08,0x7F,0xFC,0x01,0x04,0x09,0x20,0x11,0x10,0x21,0x08,0x45,0x04,0x02,0x00},等于“系”
时间: 2023-08-22 08:10:10 浏览: 109
哦,我理解了您的问题。这是一个汉字“系”的点阵表示,具体的点阵信息如下:
```
0000 0000 1111 1000 0011 1111 0000 0000 // 第一行
0000 0100 0000 0000 0000 1000 0010 0000 // 第二行
0001 0000 0100 0000 0010 0000 0100 0000 // 第三行
0011 1111 1000 0000 0001 0000 0000 0000 // 第四行
0000 0000 0000 0001 0000 0100 0000 1001 // 第五行
0010 0000 0001 0000 0010 0000 0010 0000 // 第六行
0010 0000 0100 0101 0000 0100 0000 0010 // 第七行
0000 0010 0000 0000 0000 0000 0000 0000 // 第八行
```
解析这个点阵,可以看到每个汉字由16行,每行8个点组成。其中,第一行到第八行的每个点用一个二进制位表示,0表示该位置不亮,1表示该位置亮。对于这个汉字“系”,相应的点阵信息经过处理,可以表示成您提供的十六进制数值。
相关问题
const unsigned char Hzk[][32] PROGMEM ={ {0x00,0x00,0xF0,0x10,0x10,0x10,0x10,0xFF,0x10,0x10,0x10,0x10,0xF0,0x00,0x00,0x00,0x00,0x00,0x0F,0x04,0x04,0x04,0x04,0xFF,0x04,0x04,0x04,0x04,0x0F,0x00,0x00,0x00},/*"中",0*/ {0x40,0x40,0x40,0x5F,0x55,0x55,0x55,0x75,0x55,0x55,0x55,0x5F,0x40,0x40,0x40,0x00,0x00,0x40,0x20,0x0F,0x09,0x49,0x89,0x79,0x09,0x09,0x09,0x0F,0x20,0x40,0x00,0x00},/*"景",1*/ {0x00,0xFE,0x02,0x42,0x4A,0xCA,0x4A,0x4A,0xCA,0x4A,0x4A,0x42,0x02,0xFE,0x00,0x00,0x00,0xFF,0x40,0x50,0x4C,0x43,0x40,0x40,0x4F,0x50,0x50,0x5C,0x40,0xFF,0x00,0x00},/*"园",2*/ {0x00,0x00,0xF8,0x88,0x88,0x88,0x88,0xFF,0x88,0x88,0x88,0x88,0xF8,0x00,0x00,0x00,0x00,0x00,0x1F,0x08,0x08,0x08,0x08,0x7F,0x88,0x88,0x88,0x88,0x9F,0x80,0xF0,0x00},/*"电",3*/ {0x80,0x82,0x82,0x82,0x82,0x82,0x82,0xE2,0xA2,0x92,0x8A,0x86,0x82,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x80,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"子",4*/ {0x10,0x10,0x10,0xFF,0x10,0x90,0x08,0x88,0x88,0x88,0xFF,0x88,0x88,0x88,0x08,0x00,0x04,0x44,0x82,0x7F,0x01,0x80,0x80,0x40,0x43,0x2C,0x10,0x28,0x46,0x81,0x80,0x00},/*"技",5*/ {0x00,0x10,0x10,0x10,0x10,0xD0,0x30,0xFF,0x30,0xD0,0x12,0x1C,0x10,0x10,0x00,0x00,0x10,0x08,0x04,0x02,0x01,0x00,0x00,0xFF,0x00,0x00,0x01,0x02,0x04,0x08,0x10,0x00},/*"术",6*/ };
这是一个二维数组,每个元素都是一个长度为 32 的一维数组,表示一个汉字的点阵数据。例如,第一个元素表示汉字“中”的点阵数据,第二个元素表示汉字“景”的点阵数据,以此类推。
这里的 `PROGMEM` 是指将该数组保存在程序存储空间的 flash 存储区域中,而不是 RAM 存储区域中,可以减少 RAM 的占用。在使用这个数组时,需要使用 `pgm_read_byte()` 等函数来读取 flash 存储区域中的数据。
#include <reg52.h> unsigned char *p1,*p2,*p3,*p4,*p5; unsigned char k; sbit right = P0^0; sbit left = P0^1; unsigned char code table[]={0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f}; unsigned char code decode[][16]={ {0x00,0x00,0x00,0x06,0x06,0x0F,0x02,0x3F,0x0C,0x1E,0x3F,0x62,0xC0,0x00,0x00,0x00}, {0x00,0x00,0x00,0x6F,0xD9,0xFB,0x16,0xFE,0x26,0x66,0x64,0xD8,0xC0,0x00,0x00,0x00},/*"郑",0*/ {0x00,0x00,0x00,0x01,0x0F,0x03,0x00,0x1F,0x03,0x32,0x6C,0x18,0x63,0x00,0x00,0x00}, {0x00,0x00,0x00,0x84,0xFF,0x08,0x80,0xF8,0x1C,0x34,0x34,0x60,0xC0,0x00,0x00,0x00},/*"苏",1*/ {0x00,0x00,0x00,0x0F,0x00,0x0F,0x18,0x1E,0x37,0x31,0x29,0x7F,0x43,0x00,0x00,0x00}, {0x00,0x00,0x00,0xFF,0x60,0xFF,0xC3,0xF6,0xFE,0xAC,0xFC,0x18,0x70,0x00,0x00,0x00},/*"雨",2*/ {0x00,0x00,0x00,0x07,0x06,0x0F,0x0C,0x0F,0x00,0x7F,0x01,0x03,0x03,0x00,0x00,0x00}, {0x00,0x00,0x00,0xFF,0x03,0xFE,0x06,0xFC,0xC0,0xFE,0x80,0x00,0x00,0x00,0x00,0x00},/*"早",3*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x03,0x03,0xFF,0x00,0x00,0x00}, {0x00,0x00,0x00,0x60,0x60,0xE0,0xC0,0xFE,0x80,0x80,0x00,0x00,0xF8,0x00,0x00,0x00},/*"上",4*/ {0x00,0x00,0x00,0x03,0x06,0x1F,0x0D,0x1B,0x36,0x1C,0x1C,0x76,0xC1,0x00,0x00,0x00}, {0x00,0x00,0x00,0x1F,0x03,0x86,0x8C,0xFF,0x18,0x30,0x30,0x60,0xC0,0x00,0x00,0x00},/*"好",5*/ {0x00,0x00,0x00,0x00,0x0F,0x0B,0x1A,0x1F,0x35,0x2D,0x7A,0x63,0x04,0x00,0x00,0x00}, {0x00,0x00,0x00,0x18,0x7F,0xC6,0xFF,0xB2,0xFE,0x70,0xA6,0x64,0x78,0x00,0x00,0x00},/*"晚",6*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x03,0x03,0xFF,0x00,0x00,0x00}, {0x00,0x00,0x00,0x60,0x60,0xE0,0xC0,0xFE,0x80,0x80,0x00,0x00,0xF8,0x00,0x00,0x00},/*"上",7*/ {0x00,0x00,0x00,0x03,0x06,0x1F,0x0D,0x1B,0x36,0x1C,0x1C,0x76,0xC1,0x00,0x00,0x00}, {0x00,0x00,0x00,0x1F,0x03,0x86,0x8C,0xFF,0x18,0x30,0x30,0x60,0xC0,0x00,0x00,0x00},/*"好",8*/ }; void writetwochar(unsigned char,unsigned char,unsigned char,unsigned char,unsigned char); void delay(int); void main() { int originaladd,total; unsigned char i,j; originaladd=&decode[0][0]; total=sizeof(decode); p1=&decode[0][0]; p2=&decode[1][0]; p3=&decode[2][0]; p4=&decode[3][0]; p5=&decode[4][0]; while(1) { for(k=0;k<8;k++) { for(j=0;j<2;j++) { for(i=0;i<16;i++) { P2=table[i]; writetwochar(*(p5+i),*(p4+i),*(p3+i),*(p2+i),*(p1+i)); delay(10); } } } p1=p2;p2=p3;p3=p4;p4=p5;p5=p5+16; if(p5-originaladd==total) p5=&decode[0][0]; } }
这段代码是一个基于51单片机的LED点阵显示程序,可以循环显示一组预先定义好的汉字。主要的变量包括 `p1` 到 `p5`,这些变量是指向一个二维数组 `decode` 中各个汉字的指针,每个汉字占据二维数组中的一行。变量 `k` 用于循环计数,变量 `i` 和 `j` 用于遍历二维数组中的元素。
程序的主循环通过遍历二维数组 `decode` 中的元素,将每个汉字的点阵模式显示在LED点阵上。每个汉字占据LED点阵的两个行,因此在循环中需要进行两次显示。同时,程序还实现了一个循环队列,通过不断更新 `p1` 到 `p5` 的指向,实现了汉字的循环显示。
函数 `writetwochar` 用于将一个汉字的两行点阵模式写入到LED点阵上,函数 `delay` 用于实现延时效果。
需要注意的是,这段代码的具体实现可能与不同的硬件环境有关,因此需要根据具体的硬件环境进行相应的修改和调试。
阅读全文