1335 lcd显示C程序
扫描二维码
随时随地手机看文章
1335LCD显示C程序
//;-------------------------------------------------------------------
//;SED1335
//;LCM指令端口地址FFFFH:数据端口地址:FFFEH
//;320*240点阵整屏的点象素为76800,也就有9600(2580H)个字节,单屏图形方式
//;所以第一区显示缓存地址范围为:0000H----257FH
//;所以第二区显示缓存地址范围为:2580H----4AFFH
//;所以第三区显示缓存地址范围为:4B00H----707FH
//;320*240点阵整屏---一行占40个字节的显示缓存
//;
//;--------------------------------------------------------------------
//#include"word.h"
#include
#includeCC.h>
#include
#include
#include
#include
#include
#defineucharunsignedchar
#defineuintunsignedint
sbita0_lcd=P2^0;
sbitcs_lcd=P2^1;
sbitwr_lcd=P3^7;
charop,KEYD;
intsy;
voidInitKeyboard(void);
//#defineLcdCommandXBYTE[0x8000]//LCD指令入口
//#defineLcdDataWriteXBYTE[0x8100]//写LCD数据入口
voidCLEAR(void);
voidkk(ucharTT,ucharTTT,uchar*ZiKu);
voidxc(lcd_addh,lcd_addl,bmp_long,bmp_high,bmp);
//ucharcodety[]={"a,s,d"};
voidqw(ucharkk,ucharkkk,uchar*ZiKu);
voidchar_lcd(unsignedcharvalue);
voidInitKeyboard(void);
//---------------------------
ucharGetKeyStatus();
charbdatabucKeyStatus;//键的一般属性标志位
sbitbKeyDown=bucKeyStatus^0;//KeyDown
sbitbKeyPress=bucKeyStatus^1;//KeyPress
sbitbKeyUp=bucKeyStatus^2;//KeyUp
sbitbKeyFree=bucKeyStatus^3;//KeyFree
sbitbSCANKey=bucKeyStatus^4;//定时扫描标志位
ucharucKey1,ucKey2,ucKeyBak;
//--------------------------------------------------------------
voidInitialize(void);
voiddelay(uint);
voidSetCursor(uchar,uchar);
voidWriteOneWork(uchar,uchar,uchar*);
voidWriteLine(uchar,uchar,uchar);
////////////////////////////////////////////
/*--文字:,--*/
/*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/
ucharcodeBBB[]=
{
0x04,0x40,0x04,0x40,0x7F,0xFC,0x04,0x40,0x04,0x40,0xFF,0xFE,0x01,0x00,0x1F,0xF0,
0x11,0x10,0x1F,0xF0,0x11,0x10,0x11,0x10,0x1F,0xF0,0x08,0x20,0x10,0x18,0x60,0x08,
};
/*--文字:b--*/
/*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/
ucharcodeCCC[]={
0x00,0x00,0x7F,0xFC,0x40,0x04,0x5F,0xF4,0x41,0x04,0x41,0x04,0x41,0x04,0x4F,0xE4,
0x41,0x44,0x41,0x24,0x41,0x24,0x5F,0xF4,0x40,0x04,0x40,0x04,0x7F,0xFC,0x40,0x04,
};
/*--文字:,--*/
/*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/
ucharcodeDDD[]={
0x40,0x38,0x27,0xC0,0x22,0x48,0x01,0x50,0x87,0xFC,0x50,0xE0,0x11,0x58,0x26,0x46,
0x23,0xFC,0x22,0x44,0xC2,0x44,0x43,0xFC,0x42,0x44,0x42,0x44,0x43,0xFC,0x42,0x04,
};
/*--文字:c--*/
/*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/
ucharcodeN00[]=
{
0x00,0x00,0x00,0x18,0x24,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x24,0x18,0x00,0x00,
};
ucharcodeN01[]={
0x00,0x00,0x00,0x10,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00,
};
/*--文字:,--*/
/*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/
ucharcodeN02[]={
0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x04,0x04,0x08,0x10,0x20,0x42,0x7E,0x00,0x00,
};
ucharcodeN03[]={
0x00,0x00,0x00,0x3C,0x42,0x42,0x04,0x18,0x04,0x02,0x02,0x42,0x44,0x38,0x00,0x00,
};
ucharcodeN04[]={
0x00,0x00,0x00,0x04,0x0C,0x14,0x24,0x24,0x44,0x44,0x7E,0x04,0x04,0x1E,0x00,0x00,
};
ucharcodeN05[]={
0x00,0x00,0x00,0x7E,0x40,0x40,0x40,0x58,0x64,0x02,0x02,0x42,0x44,0x38,0x00,0x00,
};
ucharcodeN06[]={
0x00,0x00,0x00,0x1C,0x24,0x40,0x40,0x58,0x64,0x42,0x42,0x42,0x24,0x18,0x00,0x00,
};
ucharcodeN07[]={
0x00,0x00,0x00,0x7E,0x44,0x44,0x08,0x08,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,
};
ucharcodeN08[]={
0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x24,0x18,0x24,0x42,0x42,0x42,0x3C,0x00,0x00,
};
ucharcodeN09[]={
0x00,0x00,0x00,0x18,0x24,0x42,0x42,0x42,0x26,0x1A,0x02,0x02,0x24,0x38,0x00,0x00,
};
//------------
ucharcodeN0A[]={
0x00,0x00,0x00,0x10,0x10,0x18,0x28,0x28,0x24,0x3C,0x44,0x42,0x42,0xE7,0x00,0x00,
};
ucharcodeN0B[]={
0x00,0x00,0x00,0xF8,0x44,0x44,0x44,0x78,0x44,0x42,0x42,0x42,0x44,0xF8,0x00,0x00,
};
ucharcodeN0C[]={
0x00,0x00,0x00,0x3E,0x42,0x42,0x80,0x80,0x80,0x80,0x80,0x42,0x44,0x38,0x00,0x00,
};
///////
ucharcodeN0C10[]={
0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x18,0x18,0x00,0x00,
};
ucharcodeN0C11[]={
0x00,0x00,0x00,0x30,0x48,0x48,0x48,0x50,0x6E,0xA4,0x94,0x88,0x89,0x76,0x00,0x00,
};
ucharcodeN0C12[]={
0x00,0x00,0x00,0x3C,0x42,0x42,0x62,0x02,0x04,0x08,0x08,0x00,0x18,0x18,0x00,0x00,
};
ucharcodeN0C13[]={
0x00,0x00,0x00,0x02,0x04,0x08,0x10,0x20,0x40,0x20,0x10,0x08,0x04,0x02,0x00,0x00,
};
ucharcodeN0C14[]={
0x00,0x00,0x00,0x40,0x20,0x10,0x08,0x04,0x02,0x04,0x08,0x10,0x20,0x40,0x00,0x00,
};
/////#####
/*--文字:电--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
ucharcodedha1[]=
{
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,
};
/*--文字:话--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
ucharcodedha2[]=
{
0x40,0x00,0x20,0x1C,0x33,0xE0,0x20,0x20,0x00,0x20,0x07,0xFE,0xF0,0x20,0x10,0x20,
0x10,0x20,0x11,0xFC,0x11,0x04,0x11,0x04,0x15,0x04,0x19,0xFC,0x11,0x04,0x00,0x00,
};
/*--文字::--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
ucharcodedha3[]=
{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x30,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x30,0x00,0x00,0x00,0x00,0x00,
};
////
//###
/*--文字:传--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
ucharcodecHzeng1[]=
{
0x10,0x40,0x18,0x48,0x17,0xFC,0x20,0x40,0x20,0x80,0x60,0x84,0xAF,0xFE,0x20,0x80,
0x21,0x08,0x23,0xFC,0x20,0x08,0x21,0x10,0x20,0xA0,0x20,0x40,0x20,0x20,0x00,0x00,
};
ucharcodechzeng2[]=
{
/*--文字:真--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x01,0x00,0x01,0x04,0x7F,0xFE,0x02,0x00,0x0F,0xF0,0x08,0x10,0x0F,0xF0,0x08,0x10,
0x0F,0xF0,0x08,0x10,0x0F,0xF0,0x08,0x10,0xFF,0xFE,0x04,0x40,0x18,0x30,0x60,0x0C,
};
//------
ucharcodename1[]=
{
/*--文字:P--*/
/*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/
0x00,0x00,0x00,0xFC,0x42,0x42,0x42,0x42,0x7C,0x40,0x40,0x40,0x40,0xE0,0x00,0x00,
};
ucharcodename2[]=
{
/*--文字:/--*/
/*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/
0x00,0x00,0x01,0x02,0x02,0x04,0x04,0x08,0x08,0x10,0x10,0x20,0x20,0x40,0x40,0x00,
};
ucharcodename3[]=
{
/*--文字:N--*/
/*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/
0x00,0x00,0x00,0xC7,0x62,0x62,0x52,0x52,0x4A,0x4A,0x4A,0x46,0x46,0xE2,0x00,0x00,
};
/////
ucharcodegz1[]=
{
/*--文字:广--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x01,0x00,0x00,0x80,0x3F,0xFE,0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,
0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x40,0x00,0x40,0x00,0x80,0x00,0x00,0x00,
};
ucharcodegz2[]=
{
/*--文字:州--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x08,0x04,0x08,0x84,0x08,0x84,0x08,0x84,0x08,0xC4,0x4C,0xA4,0x4A,0xA4,0x4A,0x94,
0x88,0x94,0x08,0x84,0x08,0x84,0x10,0x84,0x10,0x84,0x20,0x84,0x20,0x84,0x40,0x04,
};
ucharcodegz3[]=
{
/*--文字:机--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x10,0x00,0x10,0xF8,0x10,0x88,0xFE,0x88,0x10,0x88,0x10,0x88,0x38,0x88,0x34,0x88,
0x54,0x88,0x50,0x88,0x91,0x08,0x11,0x0A,0x12,0x0A,0x12,0x0A,0x14,0x06,0x10,0x00,
};
ucharcodegz4[]=
{
/*--文字:械--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x20,0x20,0x20,0x28,0x20,0x24,0x23,0xFE,0xF8,0x20,0x22,0xA0,0x72,0xA4,0x6A,0xA4,
0x67,0xE8,0xA2,0xA8,0xA2,0x90,0x24,0x92,0x24,0xAA,0x28,0x4A,0x20,0x86,0x20,0x02,
};
ucharcodegz5[]=
{
/*--文字:厂--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x00,0x00,0x3F,0xFE,0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,
0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x40,0x00,0x40,0x00,0x80,0x00,0x00,0x00,
};
ucharcodexh1[]=
{
/*--文字:型--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x00,0x04,0x7F,0x84,0x12,0x24,0x12,0x24,0xFF,0xE4,0x12,0x24,0x12,0x24,0x22,0x24,
0x22,0x04,0x41,0x14,0x01,0x08,0x3F,0xFC,0x01,0x00,0x01,0x00,0xFF,0xFE,0x00,0x00,
};
ucharcodexh2[]=
{
/*--文字:号--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x1F,0xF0,0x10,0x10,0x10,0x10,0x10,0x10,0x1F,0xF0,0x00,0x00,0xFF,0xFE,0x08,0x00,
0x08,0x00,0x1F,0xF0,0x08,0x10,0x00,0x10,0x00,0x10,0x01,0x10,0x00,0xA0,0x00,0x40,
};
//
ucharcodefh[]=
{
/*--文字:>--*/
/*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/
0x00,0x00,0x00,0x40,0x20,0x10,0x08,0x04,0x02,0x04,0x08,0x10,0x20,0x40,0x00,0x00,
};
/////
ucharcodepm1[]=
{
/*--文字:全--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x01,0x00,0x01,0x00,0x02,0x80,0x04,0x40,0x08,0x30,0x10,0x1C,0x3F,0xF8,0x41,0x00,
0x01,0x00,0x01,0x10,0x1F,0xF8,0x01,0x00,0x01,0x00,0x01,0x04,0x7F,0xFE,0x00,0x00,
};
ucharcodepm2[]=
{
/*--文字:自--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x01,0x00,0x01,0x80,0x02,0x00,0x1F,0xF8,0x10,0x08,0x10,0x08,0x1F,0xF8,0x10,0x08,
0x10,0x08,0x10,0x08,0x1F,0xF8,0x10,0x08,0x10,0x08,0x10,0x08,0x1F,0xF8,0x10,0x08,
};
ucharcodepm3[]=
{
/*--文字:动--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x00,0x20,0x00,0x20,0x7E,0x20,0x00,0x20,0x00,0xFC,0xFF,0x24,0x10,0x24,0x10,0x24,
0x24,0x24,0x22,0x24,0x4F,0x44,0xFA,0x44,0x40,0x84,0x01,0x14,0x02,0x08,0x00,0x00,
};
ucharcodepm4[]=
{
/*--文字:成--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x00,0xA0,0x00,0x90,0x00,0x80,0x3F,0xFE,0x20,0x80,0x20,0x80,0x3E,0x88,0x22,0x8C,
0x22,0x48,0x22,0x50,0x22,0x20,0x2A,0x60,0x44,0x92,0x41,0x0A,0x86,0x06,0x00,0x02,
};
ucharcodepm5[]=
{
/*--文字:形--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x00,0x04,0x7F,0x86,0x12,0x0C,0x12,0x10,0x12,0x20,0x12,0x08,0xFF,0xCC,0x12,0x18,
0x12,0x20,0x12,0x44,0x12,0x86,0x12,0x0C,0x22,0x10,0x22,0x20,0x42,0x40,0x80,0x80,
};
ucharcodepm6[]=
{
/*--文字:剪--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x08,0x10,0x04,0x20,0x7F,0xFE,0x00,0x00,0x3F,0x04,0x21,0x24,0x3F,0x24,0x21,0x24,
0x3F,0x04,0x25,0x14,0x22,0x08,0x7F,0xFC,0x02,0x04,0x04,0x04,0x08,0x14,0x30,0x08,
};
ucharcodepm7[]=
{
/*--文字:切--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x10,0x00,0x10,0x00,0x13,0xFC,0x10,0x44,0x10,0x44,0x1E,0x44,0xF0,0x44,0x10,0x44,
0x10,0x44,0x12,0x84,0x14,0x84,0x19,0x04,0x11,0x04,0x02,0x14,0x04,0x08,0x00,0x00,
};
ucharcodepm8[]=
{
/*--文字:机--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x10,0x00,0x10,0xF8,0x10,0x88,0xFE,0x88,0x10,0x88,0x10,0x88,0x38,0x88,0x34,0x88,
0x54,0x88,0x50,0x88,0x91,0x08,0x11,0x0A,0x12,0x0A,0x12,0x0A,0x14,0x06,0x10,0x00,
};
ucharcodepm9[]=
{
/*--文字:名--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x04,0x00,0x04,0x00,0x07,0xF8,0x08,0x10,0x10,0x20,0x24,0x40,0x42,0x80,0x01,0x00,
0x06,0x00,0x1F,0xF8,0xE8,0x08,0x08,0x08,0x08,0x08,0x0F,0xF8,0x08,0x08,0x00,0x00,
};
ucharcodepm10[]=
{
/*--文字:称--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x0C,0x80,0x70,0x80,0x10,0xFE,0x10,0x82,0xFD,0x24,0x31,0x20,0x32,0x20,0x58,0xB0,
0x54,0xA8,0x91,0xA4,0x11,0x24,0x12,0x22,0x14,0x22,0x10,0x20,0x10,0xA0,0x10,0x40,
};
ucharcodechan[]=
{
/*--文字:产--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x01,0x00,0x00,0x80,0x7F,0xFE,0x08,0x10,0x06,0x20,0x24,0x44,0x3F,0xFE,0x20,0x00,
0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x40,0x00,0x40,0x00,0x80,0x00,0x00,0x00,
};
ucharcodePINg[]=
{
/*--文字:品--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x00,0x00,0x0F,0xF0,0x08,0x10,0x08,0x10,0x08,0x10,0x0F,0xF0,0x08,0x10,0x00,0x00,
0x7E,0xFC,0x42,0x84,0x42,0x84,0x42,0x84,0x42,0x84,0x7E,0xFC,0x42,0x84,0x00,0x00,
};
ucharcodexieng[]=
{
/*--文字:型--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x00,0x04,0x7F,0x84,0x12,0x24,0x12,0x24,0xFF,0xE4,0x12,0x24,0x12,0x24,0x22,0x24,
0x22,0x04,0x41,0x14,0x01,0x08,0x3F,0xFC,0x01,0x00,0x01,0x00,0xFF,0xFE,0x00,0x00,
};
ucharcodexu[]=
{
/*--文字:数--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x08,0x20,0x49,0x30,0x2A,0x20,0x1C,0x20,0xFF,0x7E,0x1C,0x44,0x2B,0x44,0x48,0xC4,
0x08,0x28,0xFF,0x28,0x12,0x10,0x34,0x10,0x0C,0x28,0x32,0x4E,0xC0,0x84,0x00,0x00,
};
ucharcodelang[]=
{
/*--文字:量--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x1F,0xF0,0x10,0x10,0x1F,0xF0,0x10,0x10,0x1F,0xF0,0x00,0x00,0xFF,0xFE,0x11,0x10,
0x1F,0xF0,0x11,0x10,0x1F,0xF0,0x01,0x00,0x1F,0xF8,0x01,0x00,0xFF,0xFE,0x00,0x00,
};
ucharcodedang[]=
{
/*--文字:当--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x00,0x80,0x10,0x90,0x08,0x98,0x0C,0x90,0x08,0xA0,0x00,0x80,0x3F,0xFC,0x00,0x04,
0x00,0x04,0x1F,0xFC,0x00,0x04,0x00,0x04,0x00,0x04,0x3F,0xFC,0x00,0x04,0x00,0x00,
};
ucharcodeqan[]=
{
/*--文字:前--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x08,0x10,0x06,0x18,0x04,0x20,0xFF,0xFE,0x00,0x00,0x3E,0x08,0x22,0x48,0x3E,0x48,
0x22,0x48,0x22,0x48,0x3E,0x48,0x22,0x48,0x22,0x48,0x2A,0x08,0x24,0x28,0x00,0x10,
};
ucharcodeduong[]=
{
/*--文字:工--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x00,0x00,0x3F,0xFC,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,
0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0xFF,0xFE,0x00,0x00,0x00,0x00,
};
ucharcodezuo[]=
{
/*--文字:作--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x08,0x80,0x0C,0x80,0x09,0x00,0x13,0xFE,0x12,0x80,0x34,0x88,0x50,0xFC,0x90,0x80,
0x10,0x80,0x10,0x84,0x10,0xFE,0x10,0x80,0x10,0x80,0x10,0x80,0x10,0x80,0x10,0x80,
};
ucharcodechan1[]=
{
/*--文字:参--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x04,0x00,0x0C,0x20,0x11,0xF0,0x3F,0x10,0x02,0x00,0xFF,0xFC,0x04,0x40,0x09,0x20,
0x32,0x18,0xCC,0x6E,0x31,0x84,0x06,0x18,0x18,0x60,0x03,0x80,0x7C,0x00,0x00,0x00,
};
ucharcodese[]=
{
/*--文字:设--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x40,0x00,0x21,0xF0,0x31,0x10,0x21,0x10,0x01,0x10,0x01,0x10,0xE2,0x0E,0x25,0xF8,
0x21,0x08,0x21,0x08,0x20,0x90,0x20,0x90,0x28,0x60,0x30,0x90,0x23,0x0E,0x0C,0x04,
};
ucharcodezi[]=
{
/*--文字:置--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x3F,0xF8,0x24,0x48,0x24,0x48,0x3F,0xF8,0x01,0x00,0x7F,0xFC,0x02,0x00,0x1F,0xF0,
0x10,0x10,0x1F,0xF0,0x10,0x10,0x1F,0xF0,0x10,0x10,0x1F,0xF0,0x10,0x10,0xFF,0xFE,
};
ucharcodeqen[]=
{
/*--文字:欠--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x08,0x00,0x0C,0x00,0x08,0x00,0x1F,0xFC,0x10,0x08,0x21,0x10,0x41,0x20,0x81,0x00,
0x02,0x80,0x02,0x80,0x04,0x40,0x04,0x40,0x08,0x30,0x30,0x1E,0xC0,0x08,0x00,0x00,
};
ucharcodeyi[]=
{
/*--文字:预--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x00,0x00,0x7D,0xFE,0x04,0x20,0x28,0x40,0x10,0xFC,0xFE,0x84,0x14,0xA4,0x10,0xA4,
0x10,0xA4,0x10,0xA4,0x10,0xA4,0x10,0x50,0x10,0x48,0x50,0x86,0x23,0x02,0x00,0x00,
};
ucharcodejji[]=
{
/*--文字:计--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x40,0x20,0x20,0x20,0x30,0x20,0x20,0x20,0x00,0x20,0xF3,0xFE,0x10,0x20,0x10,0x20,
0x10,0x20,0x10,0x20,0x10,0x20,0x12,0x20,0x14,0x20,0x18,0x20,0x10,0x20,0x00,0x20,
};
ucharcodegang[]=
{
/*--文字:---*/
/*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};
///
ucharcodezong[]=
{
/*--文字:总--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x08,0x20,0x04,0x20,0x04,0x40,0x1F,0xF0,0x10,0x10,0x10,0x10,0x10,0x10,0x1F,0xF0,
0x00,0x00,0x01,0x00,0x08,0x88,0x28,0x84,0x28,0x16,0x68,0x12,0x07,0xF0,0x00,0x00,
};
ucharcodehe[]=
{
/*--文字:时--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x00,0x10,0x00,0x10,0x7C,0x10,0x44,0x10,0x47,0xFE,0x44,0x10,0x7C,0x10,0x45,0x10,
0x44,0x90,0x44,0x90,0x7C,0x10,0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x50,0x00,0x20,
};
ucharcodeei[]=
{
/*--文字:已--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x00,0x00,0x3F,0xF0,0x00,0x10,0x00,0x10,0x00,0x10,0x20,0x10,0x3F,0xF0,0x20,0x00,
0x20,0x00,0x20,0x00,0x20,0x04,0x20,0x04,0x20,0x06,0x3F,0xFC,0x00,0x00,0x00,0x00,
};
ucharcodehao[]=
{
/*--文字:耗--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x10,0x08,0x10,0x1C,0xFD,0xE0,0x10,0x20,0x7C,0x3C,0x11,0xE0,0x10,0x20,0xFE,0x20,
0x10,0x3E,0x3B,0xE0,0x34,0x20,0x56,0x20,0x54,0x22,0x90,0x22,0x10,0x1E,0x10,0x00,
};
ucharcodehan[]=
{
/*--文字:还--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x40,0x00,0x27,0xFC,0x30,0x40,0x20,0x40,0x00,0x80,0x00,0x80,0xE1,0xA0,0x22,0x90,
0x24,0x88,0x28,0x8C,0x20,0x88,0x20,0x80,0x20,0x80,0x50,0x00,0x8F,0xFE,0x00,0x00,
};
ucharcodexie[]=
{
/*--文字:需--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x3F,0xFC,0x01,0x00,0x7F,0xFE,0x41,0x04,0x1D,0x70,0x01,0x00,0x1D,0x70,0x00,0x00,
0x7F,0xFE,0x02,0x00,0x3F,0xFC,0x24,0x44,0x24,0x44,0x24,0x44,0x24,0x54,0x20,0x08,
};
ucharcodelai[]=
{
/*--文字:累--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x1F,0xF8,0x11,0x08,0x1F,0xF8,0x11,0x08,0x1F,0xF8,0x02,0x00,0x04,0x20,0x0F,0xC0,
0x01,0x20,0x06,0x10,0x0F,0xF8,0x00,0x88,0x08,0xA0,0x08,0x98,0x12,0x88,0x01,0x00,
};
ucharcodeja[]=
{
/*--文字:加--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/
0x08,0x00,0x08,0x00,0x08,0x00,0x7F,0x7C,0x09,0x44,0x09,0x44,0x09,0x44,0x09,0x44,
0x11,0x44,0x11,0x44,0x11,0x44,0x21,0x44,0x21,0x7C,0x45,0x44,0x82,0x40,0x00,0x00,
};
ucharcodekong[]=
{
/*--文字:--*/
/*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};
//----------------------------
ucharcodesuzi[11][17]=
{
{
/*--文字:0--*/
/*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/
0x00,0x00,0x00,0x18,0x24,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x24,0x18,0x00,0x00,
},
{
/*--文字:1--*/
/*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/
0x00,0x00,0x00,0x10,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00,
},
{
/*--文字:2--*/
/*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/
0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x04,0x04,0x08,0x10,0x20,0x42,0x7E,0x00,0x00,
},
{
/*--文字:3--*/
/*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/
0x00,0x00,0x00,0x3C,0x42,0x42,0x04,0x18,0x04,0x02,0x02,0x42,0x44,0x38,0x00,0x00,
},
{
/*--文字:4--*/
/*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/
0x00,0x00,0x00,0x04,0x0C,0x14,0x24,0x24,0x44,0x44,0x7E,0x04,0x04,0x1E,0x00,0x00,
},
{
/*--文字:5--*/
/*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/
0x00,0x00,0x00,0x7E,0x40,0x40,0x40,0x58,0x64,0x02,0x02,0x42,0x44,0x38,0x00,0x00,
},
{
/*--文字:6--*/
/*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/
0x00,0x00,0x00,0x1C,0x24,0x40,0x40,0x58,0x64,0x42,0x42,0x42,0x24,0x18,0x00,0x00,
},
{
/*--文字:7--*/
/*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/
0x00,0x00,0x00,0x7E,0x44,0x44,0x08,0x08,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,
},
{
/*--文字:8--*/
/*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/
0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x24,0x18,0x24,0x42,0x42,0x42,0x3C,0x00,0x00,
},
{
/*--文字:9--*/
/*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/
0x00,0x00,0x00,0x18,0x24,0x42,0x42,0x42,0x26,0x1A,0x02,0x02,0x24,0x38,0x00,0x00,
}
};
/////////////////////////////////////////////
voidLcdCommand(unsignedcharlcd_cmd)
{
cs_lcd=0;
a0_lcd=1;
wr_lcd=0;
P0=lcd_cmd;
wr_lcd=1;
cs_lcd=1;
}
//写数据时序
voidLcdDataWrite(unsignedcharlcd_data)
{
cs_lcd=0;
a0_lcd=0;
wr_lcd=0;
P0=lcd_data;
wr_lcd=1;
cs_lcd=1;
}
voidmain(void)
{
charuu;
uchari;
SP=0x60;//设置堆栈地址
EA=0;//关全局中断
delay(0x30);//系统延时
Initialize();//系统功能初始化
InitKeyboard();//按键盘初始化
delay(0x9);
LcdCommand(0x4f);/*光标地址自动向下增一*/
///
WriteOneWork(1,0,gz1);//广州机械厂
WriteOneWork(1,2,gz2);
WriteOneWork(1,4,gz3);
WriteOneWork(1,6,gz4);
WriteOneWork(1,8,gz5);
WriteOneWork(9,56,pm9);//名称:
WriteOneWork(9,58,pm10);
WriteOneWork(9,60,dha3);
WriteOneWork(9,62,pm1);//全自动成型剪裁机
WriteOneWork(9,64,pm2);
WriteOneWork(9,66,pm3);
WriteOneWork(9,68,pm4);
WriteOneWork(9,70,pm5);
WriteOneWork(9,72,pm6);
WriteOneWork(9,74,pm7);
WriteOneWork(9,76,pm8);
///
WriteOneWork(6,64,xh1);//型号:
WriteOneWork(6,66,xh2);
WriteOneWork(6,68,dha3);
WriteOneWork(32,48,dha1);//电话:
WriteOneWork(32,50,dha2);
WriteOneWork(32,52,dha3);
kk(32,53,N08);
kk(32,54,N07);
kk(32,55,N05);
kk(32,56,N03);
kk(32,57,N08);
kk(32,58,N00);
kk(32,59,N08);
kk(32,60,N00);
WriteOneWork(32,70,chzeng1);//传真:
WriteOneWork(32,72,chzeng2);
WriteOneWork(32,74,dha3);
kk(32,75,dha3);
kk(32,76,N00);
kk(32,77,N01);
kk(32,78,N02);
kk(32,79,N03);
kk(32,80,N04);
kk(32,81,N05);
kk(32,82,N06);
kk(32,83,N07);
//---------
kk(35,00,name1);//P/N:000000000000
kk(35,01,name2);
kk(35,02,name3);
WriteOneWork(35,04,dha3);
kk(35,5,N00);
kk(35,6,N00);
kk(35,7,N00);
kk(35,8,N00);
kk(35,9,N00);
kk(35,10,N00);
kk(35,11,N00);
kk(35,12,N00);
kk(35,13,N00);
kk(35,14,N00);
kk(35,15,N00);
kk(35,16,N00);
kk(35,17,N00);
kk(35,18,N00);
kk(35,19,N00);
kk(35,20,N00);
for(uu=31;uu<70;uu++)//进入符号》》》》》》》》》》》
{
kk(28,uu,fh);
delay(10000);
}
//$$$$$$$$$$$$$$$$$
CLEAR();
//LcdDataWrite(0x59);/*显示状态设置*/
//LcdDataWrite(0x54);/*设置参数:显示一~四区开显示*/
//for(uu=31;uu<70;uu++)
//{
//kk(128,uu,fh);
//delay(20000);
//}
LcdCommand(0x4f);/*光标地址自动向下增一*/
LcdCommand(0x42);/*允许MPU连续地把显示数据写入显示区内命令*/
WriteOneWork(1,74,pm6);//剪切机工作参数设置
WriteOneWork(1,76,pm7);
WriteOneWork(1,78,pm8);
WriteOneWork(1,0,duong);
WriteOneWork(1,2,zuo);
WriteOneWork(1,4,chan1);
WriteOneWork(1,6,xu);
WriteOneWork(1,8,se);
WriteOneWork(1,10,zi);
//WriteOneWork(1,8,gz5);
for(uu=14;uu<55;uu++)//----------------------
{
kk(4,uu,gang);
//delay(20000);
}
WriteOneWork(6,64,chan);//产品型号:
WriteOneWork(6,66,ping);
WriteOneWork(6,68,xieng);
WriteOneWork(6,70,xh2);
WriteOneWork(6,72,dha3);
WriteOneWork(9,56,pm6);//剪切数量
WriteOneWork(9,58,pm7);
WriteOneWork(9,60,xu);
WriteOneWork(9,62,lang);
WriteOneWork(9,64,dha3);
WriteOneWork(12,48,dang);//当前量数
WriteOneWork(12,50,qan);
WriteOneWork(12,52,xu);
WriteOneWork(12,54,lang);
WriteOneWork(12,56,dha3);
/////////--------------
WriteOneWork(15,40,qen);//欠预计产量数
WriteOneWork(15,42,yi);
WriteOneWork(15,44,jji);
WriteOneWork(15,46,chan);
WriteOneWork(15,48,lang);
WriteOneWork(15,50,xu);
WriteOneWork(15,52,dha3);
for(uu=30;uu<70;uu++)//---------------------
{
kk(18,uu,gang);
//delay(10000);
}
WriteOneWork(21,24,yi);//40//预计总工时
WriteOneWork(21,26,jji);
WriteOneWork(21,28,zong);
WriteOneWork(21,30,duong);
WriteOneWork(21,32,he);
WriteOneWork(21,34,dha3);
WriteOneWork(24,56,ei);//已耗总工时
WriteOneWork(24,58,hao);
WriteOneWork(24,60,duong);
WriteOneWork(24,62,he);
WriteOneWork(24,64,dha3);
//预计还需工时
WriteOneWork(27,48,yi);
WriteOneWork(27,50,jji);
WriteOneWork(27,52,han);
WriteOneWork(27,54,xie);
WriteOneWork(27,56,duong);
WriteOneWork(27,58,he);
WriteOneWork(27,60,dha3);
WriteOneWork(30,40,lai);//累加产量
WriteOneWork(30,42,jji);
WriteOneWork(30,44,chan);
WriteOneWork(30,46,lang);
WriteOneWork(30,48,dha3);
for(uu=31;uu<71;uu++)//--------------
{
kk(33,uu,gang);
//delay(20000);
}
//for(uu=39;uu<79;uu++)
//{
//kk(35,uu,fh);
//delay(2000);
//}
while(1)
{
for(uu=39;uu<79;uu++)//显示》》》》》》》》
{
kk(35,uu,fh);
delay(200);
}
for(uu=39;uu<79;uu++)//关》》》》》》》》》》
{
kk(35,uu,kong);
//delay(2000);
}
//KEYD=GetKeyStatus();
for(sy=0;sy<10;sy++)
{
//kk(35,50,kong);
//delay(2000);
//bScanKey=1;
kk(30,49,suzi[sy]);
delay(40000);
//kk(35,50,kong);
//while(1);
}
}
}
/********************************初始化LCD函数
********************************/
voidInitialize(void)
{
uinti;
LcdCommand(0x40);/*LCDSYSTEMSET系统设置令,8个参数*/
LcdDataWrite(0x30);//P1=(DR=IV=1=W/S=M2=M1=M0=0)
LcdDataWrite(0x87);//P2=(WF=1)FX=111‘B驱动方工和字体宽度
LcdDataWrite(0x07);//字符高度设置
LcdDataWrite(39);/*显示域长度为320dot*/
LcdDataWrite(0x36);/*确定液晶工作频率*/
LcdDataWrite(239);/*显示屏高度为240dot*/
LcdDataWrite(40);/*显示屏一行所占显示缓冲区字节数(L)*/
LcdDataWrite(0);/*显示屏一行所占显示缓冲区字节数(H)*/
delay(1000);
LcdCommand(0x44);/*LCDSCROLL显示区设置命令,最多10个参数*/
LcdDataWrite(0x00);/*显示1区对应的显示RAM起始高8位地址*/
LcdDataWrite(0x00);/*显示1区对应的显示RAM起始低8位地址*/
LcdDataWrite(240);/*显示1区占用240个dot行*/
LcdDataWrite(0x80);/*显示2区对应的显示RAM起始低8位地址*/
LcdDataWrite(0x25);/*显示2区对应的显示RAM起始高8位地址*/
LcdDataWrite(240);/*显示3区占用240个dot行*/
LcdDataWrite(0x00);/*显示3区对应的显示RAM起始低8位地址*/
LcdDataWrite(0x4b);/*显示3区对应的显示RAM起始高8位地址*/
delay(100);
LcdCommand(0x5a);/*水平卷动,初始化时必须清零*/
LcdDataWrite(0x00);
delay(100);
LcdCommand(0x5b);/*各个显示区的合成方式,1个参数*/
LcdDataWrite(0x1c);/*参数:显示方式为三屏图形叠加,逻辑或*/
delay(100);
LcdCommand(0x59);/*打开显示,1个参数*/
LcdDataWrite(0x04);/*只显示第一个区并关闪烁*/
delay(100);
LcdCommand(0x4c);/*光标自动向右增一?*/
delay(100);
LcdCommand(0x46);/*设定光标位置命令*/
LcdDataWrite(0);/*从0000位置开始*/
LcdDataWrite(0);
delay(100);
LcdCommand(0x42);/*允许MPU连续地把显示数据写入显示区内命令*/
for(i=0;i<32760;i++)
{
LcdDataWrite(0);//1;//0;/*将32K显缓全部清零,即LCD不显示任何东西*/
}
}
/*--------------------------设定光标,允许显示-------------------------*/
voidSetCursor(ucharCursorHIGH,ucharCursorLOW)
{
delay(100);
LcdCommand(0x46);/*设定光标位置命令*/
LcdDataWrite(CursorLOW);/*从0000位置开始*/
LcdDataWrite(CursorHIGH);
delay(100);
LcdCommand(0x42);/*允许MPU连续地把显示数据写入显示区内命令*/
}
/*---------------------------在指定位置显示一个汉字---------------------------
*/
voidWriteOneWork(ucharCurHIGH,ucharCurLOW,uchar*ZiKu)
{
uchari;
SetCursor(CurHIGH,CurLOW);/*设定光标,允许显示*/
i=0;
do
{
LcdDataWrite(ZiKu[i]);
i=i+2;
}
while(i<0x1e);//0x1e
SetCursor(CurHIGH,CurLOW+1);
i=1;
while(i<0x1f)//0x1f
{
LcdDataWrite(ZiKu[i]);
i=i+2;
}
}
/*----------------数字显示--------------------------*/
voidkk(ucharTT,ucharTTT,uchar*ZiKu)
{
uchari;
SetCursor(TT,TTT+1);/*设定光标,允许显示*/
i=0;
do
{
LcdDataWrite(ZiKu[i]);
i=i+1;
}
while(i<0xf);
SetCursor(TT,TTT+1);
i=1;
while(i<0xf)
{
LcdDataWrite(ZiKu[i]);
i=i+1;
}
}
/////
/*---------------------------在指定位置显示一个汉字---------------------------
voidqw(ucharkk,ucharkkk,uchar*ZiKu)
{
uchari;
SetCursor(kk,kkk);
i=0;
do
{
LcdDataWrite(ZiKu[i]);
i=i+2;
}
while(i<0x78);//0x1e
SetCursor(kk,kkk+1);
i=1;
while(i<0x78)//0x1f
{
LcdDataWrite(ZiKu[i]);
i=i+2;
}
SetCursor(kk,kkk+2);
i=1;
while(i<0x78)//0x1f
{
LcdDataWrite(ZiKu[i]);
i=i+2;
}
SetCursor(kk,kkk+3);
i=1;
while(i<0x78)//0x1f
{
LcdDataWrite(ZiKu[i]);
i=i+2;
}
SetCursor(kk,kkk+4);
i=1;
while(i<0x78)//0x1f
{
LcdDataWrite(ZiKu[i]);
i=i+2;
}
}
voidxc(lcd_addh,lcd_addl,bmp_long,bmp_high,bmp)
unsignedcharlcd_addh;
unsignedcharlcd_addl;
unsignedcharbmp_long;
unsignedcharbmp_high;
unsignedcharbmp[];
{
unsignedchari,j;
unsignedintk=0;
union{
unsignedintk;
unsignedcharlcd_add[2];
}a;//定义数据组
a.lcd_add[0]=lcd_addh;
a.lcd_add[1]=lcd_addl;
for(i=0;i
SetCursor(a.lcd_add[0],a.lcd_add[1]);//X,Y
for(j=0;j
WriteOneWork(tt[k]);
k++;
}
a.k+=40;
}
}
*/
voidCLEAR(void)
{
unsignedinti,j;
LcdCommand(0x4c);/*CSRDIR代码*/
LcdCommand(0x46);/*CSRW代码*/
LcdDataWrite(0x00);/*设置参数光标指针低8位*/
LcdDataWrite(0x00);/*设置参数光标指针高8位*/
LcdCommand(0x42);/*MWRITE代码*/
for(j=0;j<2195;j++)/*清64K的显示存储器*/
{
for(i=0;i<30;i++)/*写入一行*/
{
LcdDataWrite(0x00);/*写入数据*/
}
}
}
/*----------------------延时子程序-----------------------------*/
voiddelay(uintdelx)
{
uinti=0;
while(i
i++;
}
}