简单菜单系统 Proteus pg12864 液晶
void clear_screen()
{
uint i;
write_cmd3(0x00,0x00,0x24);//地址指针设置
check_status();
write_cmd1(0xb0);//数据自动写,每写一次,地址指针自动加一
check_status();
for(i=0;i<8192;i++)
{
check_status();
write_data(0X00);
}
check_status();
write_cmd1(0xb2);//数据自动写结束
}
void write_data(uchar data)
{
RD_H();
CD_L();
CE_L();
WR_L();
PORTB=data;
asm("nop");
//delay(1);
WR_H();
CE_H();
CD_H();
}
void write_cmd1(uchar cmd)
{
RD_H();
CD_H();
CE_L();
WR_L();
PORTB=cmd;
asm("nop");
//delay(1);//须延时80ns左右
WR_H();
CE_H();
CD_L();
}
//先送参数,再送指令
void write_cmd2(uchar data,uchar cmd)
{
check_status();
write_data(data);
check_status();
write_cmd1(cmd);
}
void write_cmd3(uchar data1,uchar data2,uchar cmd)
{
check_status();
write_data(data1);
check_status();
write_data(data2);
check_status();
write_cmd1(cmd);
}
//#pragma data:code
uchar HZ[4][32]={
{0x00,0xF8,0x3F,0x90,0x12,0x10,0x09,0x20,0x3F,0xFE,0x22,0x02,0x42,0x00,0x3F,0xFC,0x04,0x00,0x07,0xF0,0x0C,0x20,0x0B,0x40,0x10,0xC0,0x63,0x30,0x8C,0x0E,0x30,0x04},/*"爱",0*/
{0x06,0x40,0x38,0x50,0x08,0x48,0x08,0x48,0x08,0x40,0xFF,0xFE,0x08,0x40,0x08,0x48,0x0E,0x28,0x38,0x30,0xC8,0x20,0x08,0x50,0x09,0x92,0x08,0x0A,0x28,0x06,0x10,0x02},/*"我",1*/
{0x01,0x00,0x01,0x00,0x21,0x08,0x3F,0xFC,0x21,0x08,0x21,0x08,0x21,0x08,0x21,0x08,0x21,0x08,0x3F,0xF8,0x21,0x08,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00},/*"中",2*/
{0x08,0x80,0x0C,0x88,0x10,0x9C,0x30,0xE0,0x53,0x80,0x90,0x84,0x10,0x84,0x10,0x7C,0x11,0x00,0x01,0x00,0x7F,0xFE,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00}/*"华",3*/
};
uchar HZ2[][32]=
{
{0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x21,0x04,0x21,0x04,0x21,0x04,0x21,0x04,0x21,0x04,0x21,0x04,0x21,0x04,0x21,0x04,0x7F,0xFC,0x20,0x04,0x00,0x00},/*"山",0*/
{0x02,0x00,0x02,0x00,0x7F,0xFC,0x04,0x00,0x08,0x80,0x08,0x80,0x10,0x80,0x1F,0xF8,0x00,0x80,0x08,0xA0,0x0C,0x90,0x18,0x88,0x10,0x8C,0x22,0x84,0x01,0x80,0x00,0x80},/*"东",1*/
{0x08,0x00,0x0B,0xFE,0x48,0x20,0x48,0x20,0x4B,0xFE,0x4A,0x22,0x4A,0x22,0x4A,0x22,0x4A,0x22,0x52,0x22,0x52,0x2A,0x12,0x24,0x20,0x20,0x40,0x20,0x80,0x20,0x00,0x20},/*"师",2*/
{0x04,0x20,0x04,0x20,0xFF,0xFE,0x04,0x60,0x40,0x00,0x31,0xF8,0x91,0x08,0x61,0x08,0x49,0x08,0x09,0x38,0x11,0x10,0xE1,0x00,0x21,0x04,0x21,0x04,0x20,0xFC,0x20,0x00},/*"范",3*/
{0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0xFF,0xFE,0x01,0x00,0x02,0x80,0x02,0x80,0x02,0x40,0x04,0x40,0x04,0x20,0x08,0x10,0x10,0x18,0x20,0x0E,0x40,0x04},/*"大",4*/
{0x01,0x08,0x10,0x8C,0x0C,0xC8,0x08,0x90,0x7F,0xFE,0x40,0x04,0x8F,0xE8,0x00,0x40,0x00,0x80,0x7F,0xFE,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x02,0x80,0x01,0x00},/*"学",5*/
{0x10,0x80,0x10,0x80,0x50,0x80,0x51,0xFC,0x7D,0x54,0x52,0x54,0x94,0x94,0x14,0x94,0x19,0x24,0x32,0x24,0xD4,0x44,0x10,0x84,0x11,0x04,0x12,0x04,0x14,0x28,0x00,0x10},/*"物",6*/
{0x00,0x00,0x03,0xFC,0xFA,0x44,0x22,0x44,0x23,0xFC,0x22,0x44,0xFA,0x44,0x23,0xFC,0x22,0x44,0x20,0x40,0x23,0xFC,0x38,0x40,0xC0,0x40,0x00,0x40,0x0F,0xFE,0x00,0x00},/*"理",7*/
{0x00,0x00,0x08,0x00,0x08,0x04,0x0F,0xFE,0x08,0x00,0x08,0x00,0x0F,0xFC,0x00,0x04,0x00,0x04,0x00,0x24,0x7F,0xF4,0x00,0x04,0x00,0x04,0x00,0x48,0x00,0x30,0x00,0x00},/*"与",8*/
{0x01,0x00,0x01,0x00,0x01,0x00,0x3F,0xF8,0x21,0x08,0x21,0x08,0x3F,0xF8,0x21,0x08,0x21,0x08,0x21,0x08,0x3F,0xF8,0x21,0x08,0x01,0x02,0x01,0x02,0x00,0xFE,0x00,0x00},/*"电",9*/
{0x00,0x00,0x3F,0xF0,0x00,0x20,0x00,0x40,0x00,0x80,0x01,0x00,0x01,0x00,0x01,0x04,0xFF,0xFE,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x05,0x00,0x02,0x00},/*"子",10*/
{0x06,0x08,0x78,0x88,0x08,0x48,0x08,0x48,0xFE,0x08,0x18,0x88,0x1C,0x48,0x2A,0x48,0x28,0x0E,0x48,0x78,0x8B,0x88,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08},/*"科",11*/
{0x01,0x08,0x10,0x8C,0x0C,0xC8,0x08,0
菜单系统Proteuspg12864液 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)