1. 32*32 点阵字模软件下载
//*******************************************
DWord_GB2312 Save[1]=
{
0x00,0x00,0x01,0x01,0x03,0x02,0x07,0x0C,0x08,0x10,0x20,0x06,0x07,0x06,0x06,0x06,
0x06,0x06,0x06,0x06,0x00,0x04,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x3F,0x00,0x00,
0x00,0x00,0x80,0xC0,0x02,0x07,0xFF,0x60,0x60,0x21,0x22,0x1C,0x18,0x18,0x18,0x18,
0x18,0x18,0x19,0x19,0x10,0x00,0xFF,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0xFF,0x00,0x00,
0x00,0x00,0x10,0x38,0x30,0x60,0xFF,0xC2,0x83,0x01,0x31,0x30,0x30,0x7F,0x60,0x48,
0xC7,0x83,0x01,0x00,0x00,0x00,0xFF,0x30,0x30,0x30,0x30,0x30,0x30,0xFF,0x00,0x00,
0x00,0x00,0x00,0x00,0x10,0x38,0xFC,0x00,0x00,0x00,0x00,0x00,0x10,0xF8,0x00,0x00,
0x00,0x80,0x80,0x80,0x00,0x40,0xE0,0xC0,0xC0,0xC0,0xC0,0xC8,0xDC,0xFE,0x00,0x00
};
篮(0)
{0x00,0x00,0x01,0x01,0x03,0x02,0x07,0x0C,0x08,0x10,0x20,0x06,0x07,0x06,0x06,0x06},
{0x06,0x06,0x06,0x06,0x00,0x04,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x3F,0x00,0x00},
{0x00,0x00,0x80,0xC0,0x02,0x07,0xFF,0x60,0x60,0x21,0x22,0x1C,0x18,0x18,0x18,0x18},
{0x18,0x18,0x19,0x19,0x10,0x00,0xFF,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0xFF,0x00,0x00},
{0x00,0x00,0x10,0x38,0x30,0x60,0xFF,0xC2,0x83,0x01,0x31,0x30,0x30,0x7F,0x60,0x48},
{0xC7,0x83,0x01,0x00,0x00,0x00,0xFF,0x30,0x30,0x30,0x30,0x30,0x30,0xFF,0x00,0x00},
{0x00,0x00,0x00,0x00,0x10,0x38,0xFC,0x00,0x00,0x00,0x00,0x00,0x10,0xF8,0x00,0x00},
{0x00,0x80,0x80,0x80,0x00,0x40,0xE0,0xC0,0xC0,0xC0,0xC0,0xC8,0xDC,0xFE,0x00,0x00},/*"篮",0*/
一般从"中"开始调试,因为左右上下都对称,可以减小调试的难度。
中(0) 与(1)
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x0F,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C},
{0x0C,0x0C,0x0F,0x0C,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0xFF,0x01,0x01,0x01,0x01,0x01,0x01},
{0x01,0x01,0xFF,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00},
{0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0xFF,0x80,0x80,0x80,0x80,0x80,0x80},
{0x80,0x80,0xFF,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0xF0,0x20,0x20,0x20,0x20,0x20,0x20},
{0x20,0x20,0xE0,0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"中",0*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x40,0x70,0x60,0x60,0x60,0x60,0x60,0x7F,0x60,0x60,0x60,0x40,0x40,0xFF},
{0xC0,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF},
{0x00,0x00,0x00,0x00,0x08,0x1C,0xFE,0x00,0x00,0x00,0x00,0x41,0x3F,0x0F,0x04,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0xF8,0x00,0x00,0x00,0x00,0x20,0xF0},
{0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0xC0,0xC0,0xC0,0x80,0x00,0x00,0x00},/*"与",1*/
2. 分辨率32*32=1024点 显示一个汉字
1 byte = 8 bits
1 bit 对应1个 LED点阵
1024/8 bits= 128 bytes
设计数据类型如下:
typedef struct // 汉字字模数据结构
{
unsigned char Msk[128]; // 点阵码数据
}DWord_GB2312;
单个”篮“定义
DWord_GB2312 Save[1]=
{
0x00,0x00,0x01,0x01,0x03,0x02,0x07,0x0C,0x08,0x10,0x20,0x06,0x07,0x06,0x06,0x06,
0x06,0x06,0x06,0x06,0x00,0x04,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x3F,0x00,0x00,
0x00,0x00,0x80,0xC0,0x02,0x07,0xFF,0x60,0x60,0x21,0x22,0x1C,0x18,0x18,0x18,0x18,
0x18,0x18,0x19,0x19,0x10,0x00,0xFF,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0xFF,0x00,0x00,
0x00,0x00,0x10,0x38,0x30,0x60,0xFF,0xC2,0x83,0x01,0x31,0x30,0x30,0x7F,0x60,0x48,
0xC7,0x83,0x01,0x00,0x00,0x00,0xFF,0x30,0x30,0x30,0x30,0x30,0x30,0xFF,0x00,0x00,
0x00,0x00,0x00,0x00,0x10,0x38,0xFC,0x00,0x00,0x00,0x00,0x00,0x10,0xF8,0x00,0x00,
0x00,0x80,0x80,0x80,0x00,0x40,0xE0,0xC0,0xC0,0xC0,0xC0,0xC8,0xDC,0xFE,0x00,0x00
};
3. 初步显示测试
驱 动 方式:
1/4
扫
意思是32bits分为4次扫描完成
32/4=8 Row
32/4=8 列
最小控制模块为8*8=64点阵
于是整个屏幕被分为4*4 = 16个小单元
DWord_GB2312 Save11[1]=
{
0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,
0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,
0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,
0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24,
0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x26,0x26,0x26,0x26,0x26,0x26,0x26,0x26,
0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,
};
void Color_three_send595(unsigned char buffer1,unsigned char buffer2,uint8_t Color)
{
int i;
Middle_LED_SCLK =0;
Middle_LED_SCLK2 =0;
//for(i=8;i>0;i--)
for(i=0;i<8;i++)
{
Middle_LED_CK=0;
if((buffer1&0x80)==0x80)
{
switch(Color)
{
case Red:
Middle_LED_Red = 1;
Middle_LED_Green = 0;
Middle_LED_Blue = 0;
break;
case Green:
Middle_LED_Red = 0;
Middle_LED_Green = 1;
Middle_LED_Blue = 0;
break;
case Blue:
Middle_LED_Red = 0;
Middle_LED_Green = 0;
Middle_LED_Blue = 1;
break;
case Red_Green:
Middle_LED_Red = 1;
Middle_LED_Green = 1;
Middle_LED_Blue = 0;
break;
case Red_Blue:
Middle_LED_Red = 1;
Middle_LED_Green = 0;
Middle_LED_Blue = 1;
break;
case Blue_Green:
Middle_LED_Red = 0;
Middle_LED_Green = 1;
Middle_LED_Blue = 1;
break;
case Red_Green_Blue:
Middle_LED_Red = 1;
Middle_LED_Green = 1;
Middle_LED_Blue = 1;
break;
default:
Middle_LED_Red = 1;
Middle_LED_Green = 0;
Middle_LED_Blue = 0;
break;
}
}
else
{
Middle_LED_Red = 0;
Middle_LED_Green = 0;
Middle_LED_Blue = 0;
}
if((buffer2&0x80)==0x80)
{
switch(Color)
{
case Red:
Middle_LED_Red2 = 1;
Middle_LED_Green2 = 0;
Middle_LED_Blue2 = 0;
break;
case Green:
Middle_LED_Red2 = 0;
Middle_LED_Green2 = 1;
Middle_LED_Blue2 = 0;
break;
case Blue:
Middle_LED_Red2 = 0;
Middle_LED_Green2 = 0;
Middle_LED_Blue2 = 1;
break;
case Red_Green:
Middle_LED_Red2 = 1;
Middle_LED_Green2 = 1;
Middle_LED_Blue2 = 0;
break;
case Red_Blue:
Middle_LED_Red2 = 1;
Middle_LED_Green2 = 0;
Middle_LED_Blue2 = 1;
break;
case Blue_Green:
Middle_LED_Red2 = 0;
Middle_LED_Green2 = 1;
Middle_LED_Blue2 = 1;
break;
case Red_Green_Blue:
Middle_LED_Red2 = 1;
Middle_LED_Green2 = 1;
Middle_LED_Blue2 = 1;
break;
default:
Middle_LED_Red2 = 1;
Middle_LED_Green2 = 0;
Middle_LED_Blue2 = 0;
break;
}
}
else
{
Middle_LED_Red2 = 0;
Middle_LED_Green2 = 0;
Middle_LED_Blue2 = 0;
}
Middle_LED_CK = 1;
buffer1 =buffer1<<1;
buffer2 =buffer2<<1;
}
Middle_LED_SCLK =1;
Middle_LED_SCLK2 =1;
}
old Color_Display_A();
/*void Color_Display_A(uint8_t *Data,uint8_t Row,uint8_t Color,uint8_t Led_Phase)
{
Color_send595(Data[8+Row],Color,Led_Phase);
Color_send595(Data[0+Row],Color,Led_Phase);
Color_send595(Data[24+Row],Color,Led_Phase);
Color_send595(Data[16+Row],Color,Led_Phase);
Color_send595(Data[40+Row],Color,Led_Phase);
Color_send595(Data[32+Row],Color,Led_Phase);
Color_send595(Data[56+Row],Color,Led_Phase);
Color_send595(Data[48+Row],Color,Led_Phase);
Color_send595(Data[72+Row],Color,Led_Phase);
Color_send595(Data[64+Row],Color,Led_Phase);
Color_send595(Data[88+Row],Color,Led_Phase);
Color_send595(Data[80+Row],Color,Led_Phase);
Color_send595(Data[104+Row],Color,Led_Phase);
Color_send595(Data[96+Row],Color,Led_Phase);
Color_send595(Data[120+Row],Color,Led_Phase);
Color_send595(Data[112+Row],Color,Led_Phase);
}
*/
点阵显示主要调换4*4=16个小模块的位置
void Color_Display(uint8_t *Data,uint8_t Row,uint8_t Color,uint8_t Led_Phase)
{
//GH
Color_three_send595(Data[24+Row],Data[8+Row],Color);//4-24,2-8,
Color_three_send595(Data[56+Row],Data[40+Row],Color);//8-56,11-80,
Color_three_send595(Data[16+Row],Data[Row],Color);//3-16,1-0,
Color_three_send595(Data[48+Row],Data[32+Row],Color);//7-48,5-32,
//SH
Color_three_send595(Data[88+Row],Data[72+Row],Color);//12-88,10-72
Color_three_send595(Data[120+Row],Data[104+Row],Color);//16-120,14-104
Color_three_send595(Data[80+Row],Data[64+Row],Color);//6-40,9-64
Color_three_send595(Data[112+Row],Data[96+Row],Color);//15-112,13-96
}