资源描述:
《单片机实现液晶数码相框》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、单片机实现液晶数码相框#include#include#defineucharunsignedchar#defineuintunsignedint//宏定义/*****LCD接口定义*****/sbitLCD_RS=P2^0;//1:输入数据;0:输入命令sbitLCD_RW=P2^1;//1:读数据0:写数据sbitLCD_EN=P2^2;//LCM使能端sbitLCD_PSB=P2^3;//串并口选择1:并口模式;0:串口模式;#defineLCD_DATAP1//LCD总线端口
2、//sbitS1=P3^2;//sbitS2=P3^3;/*****LCD功能初始化指令*****/#defineCLEAR_SCREEN0x01//清屏指令:清屏且AC值为00H#defineAC_INIT0x02//将AC设置为00H。且游标移到原点位置#defineCURSE_ADD0x06//设定游标移到方向及图像整体移动方向(默认游标右移,图像整体不动)#defineFUN_MODE0x30//工作模式:8位基本指令集#defineDISPLAY_ON0x0c//显示开,显示游标,且游标位置反白#defineDI
3、SPLAY_OFF0x08//显示关#defineCURSE_DIR0x14//游标向右移动:AC=AC+1#defineSET_CG_AC0x40//设置AC,范围为:00H~3FH#defineSET_DD_AC0x80/*****汉字地址表*****/ucharcodeaddr_tab[]={//便于根据汉字坐标求出地址0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,//第一行汉字位置0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,//第二行汉字位置0x
4、88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,//第三行汉字位置0x98,0x99,0x9a,0x9b,0x9c,0x9d,0x9e,0x9f,//第四行汉字位置};/*unsignedcharcodeLCDsheji[1024]={/*--调入了一幅图像:C:DocumentsandSettingsAdministrator桌面22.bmp--*//*--宽度x高度=128x64--*//*0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x
5、00,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x49,0x00,0x00,0x00,0x00,0
6、x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFF,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0xF6,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
7、0x00,0x00,0x00,0x00,0x30,0xFF,0xFF,0xFF,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x16,0x23,0xFF,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xFF,0xFF,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x01,0xE0
8、,0x07,0xFF,0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x3F,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0