51单片机12864显示汉字画图画点常用例程
更新时间:2023-09-06 18:47:01 阅读量: 教育文库 文档下载
//以下程序都是在VC++6.0 上调试运行过的程序,没有错误,没有警告。
//单片机是STC89C52RC,但是在所有的51 52单片机上都是通用的。51只是一个学习的基础平台,你懂得。
//程序在关键的位置添加了注释。
////////////////////////////////画点例程//////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////以下是 主文件 main.c 的内容
#include<reg51.h>
#include"lcd12864.h"
//--声明全局函数--//
void Delay10ms(unsigned int c); //延时10ms
/*******************************************************************************
* 函 数 名 : main
* 函数功能 : 主函数
* 输 入 : 无
* 输 出 : 无
*******************************************************************************/
void main()
{
while(1)
{
LCD12864_ClearScreen();
LCD12864_DrowPoint(127,63);
while(1);
}
}
/*******************************************************************************
* 函 数 名 : Delay10ms
* 函数功能 : 延时函数,延时10ms
* 输 入 : 无
* 输 出 : 无
*******************************************************************************/
void Delay10ms(unsigned int c) //误差 0us
{
unsigned char a, b;
//--c已经在传递过来的时候已经赋值了,所以在for语句第一句就不用赋值了--// for (;c>0;c--)
{
for (b=38;b>0;b--)
{
for (a=130;a>0;a--);
}
}
}//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////以下是被调文件 lcd12864.c 的内容
#include"lcd12864.h"
/*******************************************************************************
* 函 数 名 : LCD12864_Delay1ms
* 函数功能 : 延时1MS
* 输 入 : c
* 输 出 : 无
*******************************************************************************/
void LCD12864_Delay1ms(uint c)
{
uchar a,b;
for(; c>0; c--)
{
for(b=199; b>0; b--)
{
for(a=1; a>0; a--);
}
}
}
/*******************************************************************************
* 函 数 名 : LCD12864_Busy
* 函数功能 : 检测LCD是否忙
* 输 入 : 无
* 输 出 : 1或0(1表示不忙,0表示忙)
*******************************************************************************/
uchar LCD12864_Busy(void)
{
uchar i = 0;
LCD12864_RS = 0; //选择命令
LCD12864_RW = 1; //选择读取
LCD12864_EN = 1;
LCD12864_Delay1ms(1);
while((LCD12864_DATAPORT & 0x80) == 0x80) //检测读取到的值
{
i++;
if(i > 100)
{
LCD12864_EN = 0;
return 0; //超过等待时间返回0表示失败
}
}
LCD12864_EN = 0;
return 1;
}
/*******************************************************************************
* 函 数 名 : LCD12864_WriteCmd
* 函数功能 : 写命令
* 输 入 : cmd
* 输 出 : 无
*******************************************************************************/
void LCD12864_WriteCmd(uchar cmd)
{
uchar i;
i = 0;
while( LCD12864_Busy() == 0)
{
LCD12864_Delay1ms(1);
i++;
if( i>100)
{
return; //超过等待退出
}
}
LCD12864_RS = 0; //选择命令
LCD12864_RW = 0; //选择写入
LCD12864_EN = 0; //初始化使能端
LCD12864_DATAPORT = cmd; //放置数据
LCD12864_EN = 1; //写时序
LCD12864_Delay1ms(1);
LCD12864_EN = 0;
}
/*******************************************************************************
* 函 数 名 : LCD12864_WriteData
* 函数功能 : 写数据
* 输 入 : dat
* 输 出 : 无
*******************************************************************************/
void LCD12864_WriteData(uchar dat)
{
uchar i;
i = 0;
while( LCD12864_Busy() == 0)
{
LCD12864_Delay1ms(1);
i++;
if( i>100)
{
return; //超过等待退出
}
}
LCD12864_RS = 1; //选择数据
LCD12864_RW = 0; //选择写入
LCD12864_EN = 0; //初始化使能端
LCD12864_DATAPORT = dat; //放置数据
LCD12864_EN = 1; //写时序
LCD12864_Delay1ms(1);
LCD12864_EN = 0;
}
/*******************************************************************************
* 函 数 名 : LCD12864_ReadData
* 函数功能 : 读取数据
* 输 入 : 无
* 输 出 : 读取到的8位数据
*******************************************************************************/
#ifdef LCD12864_PICTURE
uchar LCD12864_ReadData(void)
{
uchar i, readValue;
i = 0;
while( LCD12864_Busy() == 0)
{
LCD12864_Delay1ms(1);
i++;
if( i>100)
{
return 0; //超过等待退出
}
}
LCD12864_RS = 1; //选择命令
LCD12864_RW = 1;
LCD12864_EN = 0;
LCD12864_Delay1ms(1); //等待
LCD12864_EN = 1;
LCD12864_Delay1ms(1);
readValue = LCD12864_DATAPORT;
LCD12864_EN = 0;
return readValue;
}
#endif
/*******************************************************************************
* 函 数 名 : LCD12864_Init
* 函数功能 : 初始化LCD12864
* 输 入 : 无
* 输 出 : 无
*******************************************************************************/
void LCD12864_Init()
{
LCD12864_PSB = 1; //选择并行输入
LCD12864_RST = 1; //复位
LCD12864_WriteCmd(0x30); //选择基本指令操作
LCD12864_WriteCmd(0x0c); //显示开,关光标
LCD12864_WriteCmd(0x01); //清除LCD12864的显示内容
}
/*******************************************************************************
* 函 数 名 : LCD12864_ClearScreen
* 函数功能 : 在画图模式下,LCD12864的01H命令不能清屏,所以要自己写一个清
* * 屏函数
* 输 入 : 无
* 输 出 : 无
*******************************************************************************/
#ifdef LCD12864_PICTURE
void LCD12864_ClearScreen(void)
{
uchar i,j;
LCD12864_WriteCmd(0x34); //开启拓展指令集
for(i=0;i<32;i++) //因为LCD有纵坐标32格所以写三十二次
{
LCD12864_WriteCmd(0x80+i); //先写入纵坐标Y的值
LCD12864_WriteCmd(0x80); //再写入横坐标X的值
for(j=0;j<32;j++) //横坐标有16位,每位写入两个字节的的数据,也 { //就写入32次以为当写入两个字节之后横坐标会自 LCD12864_WriteData(0x00); //动加1,所以就不用再次写入地址了。 }
}
LCD12864_WriteCmd(0x36); //0x36扩展指令里面打开绘图显示
LCD12864_WriteCmd(0x30); //恢复基本指令集
}
#endif
/*******************************************************************************
* 函 数 名 : LCD12864_SetWindow
* 函数功能 : 设置在基本指令模式下设置显示坐标。注意:x是设置行,y是设置列
* 输 入 : x, y
* 输 出 : 无
*******************************************************************************/
void LCD12864_SetWindow(uchar x, uchar y)
{
uchar pos;
if(x == 0) // 第一行的地址是80H
{
x = 0x80;
}
else if(x == 1) //第二行的地址是90H
{
x = 0x90;
}
else if(x == 2) //第三行的地址是88H
{
x = 0x88;
}
else if(x == 3)
{
x = 0x98;
}
pos = x + y;
LCD12864_WriteCmd(pos);
}
/*******************************************************************************
* 函 数 名 : LCD12864_ClearScreen
* 函数功能 : 在画图模式下,LCD12864的01H命令不能清屏,所以要自己写一个清
* * 屏函数
* 输 入 : 无
* 输 出 : 无
*******************************************************************************/
#ifdef LCD12864_PICTURE
void LCD12864_DrowPic(uchar *a)
{
unsigned char i,j;
LCD12864_ClearScreen();
LCD12864_WriteCmd(0x34); //开启扩展指令集,并关闭画图显示。
for(i=0;i<32;i++) //因为LCD有纵坐标32格所以写三十二次
{
LCD12864_WriteCmd(0x80+i); //先写入纵坐标Y的值
LCD12864_WriteCmd(0x80); //再写入横坐标X的值
for(j=0; j<16; j++) //横坐标有16位,每位写入两个字节的的数据,也 { //就写入32次以为当写入两个字节之后横坐标会自 LCD12864_WriteData(*a); //动加1,所以就不用再次写入地址了。 a++;
}
}
for(i=0; i<32; i++) //因为LCD有纵坐标32格所以写三十二次
{
LCD12864_WriteCmd(0x80+i); //先写入纵坐标Y的值
LCD12864_WriteCmd(0x88); //再写入横坐标X的值
for(j=0; j<16; j++) //横坐标有16位,每位写入两个字节的的数据,也
{ //就写入32次以为当写入两个字节之后横坐标会自 LCD12864_WriteData(*a); //动加1,所以就不用再次写入地址了。 a++; }
}
LCD12864_WriteCmd(0x36); //开显示
LCD12864_WriteCmd(0x30); //转回基本指令集
}
/*******************************************************************************
* 函 数 名 : LCD12864_DrowPoint
* 函数功能 : 在一定的坐标点亮一个点,可以用于画线条
* 输 入 : x, y
* 输 出 : 无
*******************************************************************************/
void LCD12864_DrowPoint(uchar x, uchar y)
{
uint bt = 0, readValue = 0;
uchar x_adr, y_adr, h_bit, l_bit;
//--Y轴最大一共64,但是12864分为上半屏和下半屏,超过32就是下半屏了,--// //--地址得又从零开始了。所以对32求余数,得到Y轴的坐标,然后加上80H的基地址--//
y_adr = 0x80 + y % 32; //计算Y轴的地址
//--当Y大于31时是下半屏,X(水平位置的地址)是从88H开始的,而且它是16位一--//
//--个地址,所以对16求模。而上半屏的地址是从80H开始的--//
if(y>31)
{
x_adr = 0x88 + x / 16; //计算X轴的地址
}
else
{
x_adr = 0x80 + x / 16;
}
//--求出X(水平位置),点亮的点是在16位数据里面的哪一个位--//
//--所以对这个数求余数--//
bt = 0x8000 >> (x % 16);
LCD12864_WriteCmd(0x34); //进入拓展指令集
LCD12864_WriteCmd(y_adr); //读取数据的时候要先写入所取数据的地址 LCD12864_WriteCmd(x_adr);
LCD12864_ReadData(); //读取的第一个字节不要,
readValue = LCD12864_ReadData(); //从第二个字节开始接收。
readValue <<= 8;
readValue |= LCD12864_ReadData();
bt = bt | readValue;
h_bit = bt >> 8;
l_bit = bt;
LCD12864_WriteCmd(y_adr); //写入点的时候,从新写入地址,因为地址已经改变。
LCD12864_WriteCmd(x_adr);
LCD12864_WriteData(h_bit);
LCD12864_WriteData(l_bit);
LCD12864_WriteCmd(0x36); //开显示
LCD12864_WriteCmd(0x30); //关闭绘图指令集
}
#endif
//////////////////////////////////////////////////画图例程////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////以下是 主文件 main.c 的内容
#include<reg51.h>
#include"lcd12864.h"
//---图片代码---//
unsigned char code Photo1[] ={
0x00,0x00,0x00,0x04,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,0x01,0x3F,0xC0,
0x80,0x42,0x04,0x20,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x8A,0x1F,
0xFC,0x42,0x04,0xF8,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x80,
0x00,0x00,0x00,0x00,0x00,0x01,0x2A,0x87,
0xF0,0xA2,0x0A,0xF8,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xBF,0x84,
0x10,0xA2,0x0A,0x88,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x1F,
0xFC,0xA2,0x0A,0xF8,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x9F,0x90,
0x05,0x2F,0xCA,0xA4,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x03,
0xE1,0xA8,0x4A,0xA8,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xBF,0xC2,
0x24,0x48,0x44,0x90,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x92,0x84,
0x24,0xA8,0x4A,0xA8,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xA6,0x58,
0x3D,0x0F,0xD0,0xC4,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x1C,0xFF,0xC0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x23,0x08,0x37,0x80,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x40,0x10,0x08,0x40,0x00,0xFF,0x90,
0x10,0x08,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x81,0x86,0x10,0x40,0x00,0x08,0x08,
0x10,0xFF,0x86,0x00,0x00,0x00,0x00,0x00,
0x01,0x02,0x49,0x40,0x40,0x00,0x7F,0x0B,
0xFC,0x08,0x0F,0x00,0x00,0x00,0x00,0x00,
0x01,0x08,0x00,0x40,0x20,0x00,0x10,0x00,
0x10,0x49,0x0F,0x00,0x00,0x00,0x00,0x00,
0x02,0x08,0x00,0x20,0x20,0x01,0xFF,0xDD,
0x10,0x2A,0x0F,0x00,0x00,0x00,0x00,0x00,
0x04,0x31,0x83,0x20,0x20,0x00,0x20,0x04,
0x91,0xFF,0xC6,0x00,0x00,0x00,0x00,0x00,
0x04,0x52,0x44,0x90,0x20,0x00,0x7F,0x04,
0x90,0x1C,0x06,0x00,0x00,0x00,0x00,0x00,
0x09,0xA4,0x28,0x4C,0x10,0x00,0xA1,0x04,
0x10,0x2A,0x00,0x00,0x00,0x00,0x00,0x00,
0x0E,0x44,0xE9,0xC3,0x90,0x01,0x3F,0x04,
0x70,0x49,0x06,0x00,0x00,0x00,0x00,0x00,
0x00,0x82,0xC5,0x81,0x70,0x00,0x21,0x0A,
0x01,0x88,0xC6,0x00,0x00,0x00,0x00,0x00,
0x01,0x01,0x83,0x00,0x80,0x00,0x3F,0x11,
0x01,0x0C,0x70,0x00,0x80,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x02,0x13,0x87,0x10,0x40,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x02,0x20,0x78,0xA0,0x40,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x02,0x20,0x00,0x60,0x40,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x02,0x21,0x80,0x60,0x40,0x00,0x00,0x71,
0xEE,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,
0x01,0x11,0x98,0x90,0x80,0x00,0x00,0x8E,
0x31,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,
0x01,0x08,0x18,0x80,0x80,0x00,0x01,0x24,
0x24,0x83,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x96,0x01,0x01,0x00,0x00,0x01,0x40,
0x28,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x49,0x86,0x03,0x00,0x00,0x01,0x40,
0x28,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x34,0x78,0x8C,0x00,0x00,0x01,0x00,
0x20,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x0E,0x01,0x30,0x00,0x00,0x00,0x80,
0x30,0x06,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x71,0x87,0xCE,0x00,0x00,0x00,0x40,
0x68,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xE0,0x78,0x07,0x00,0x00,0x00,0x20,
0xC4,0x18,0x00,0x00,0x00,0x00,0x00,0x00,
0x01,0xAF,0xFF,0xC5,0x80,0x00,0x00,0x11,
0x82,0x30,0x00,0x00,0x00,0x00,0x00,0x00,
0x03,0xA9,0xB6,0x45,0xC0,0x00,0x00,0x0B,
0x01,0x60,0x00,0x00,0x00,0x00,0x00,0x00,
0x07,0x2F,0x03,0xC4,0xE0,0x00,0x00,0x06,
0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,
0x0E,0x16,0x01,0x88,0x70,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x0F,0x08,0x00,0x10,0xF0,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x0F,0x84,0x00,0x21,0xF0,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,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,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,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,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,
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,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
/******************************************************************************/
unsigned char code Photo2[] ={
/*-- 调入了一幅图像:G:\HC-6800\12864\C语言\pz.bmp --*/
/*-- 宽度x高度=128x64 --*/
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,0x3F,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x80, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFE,0x60, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x63,0x20, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x63,0x10,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x63,0x08, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x7E,0x08, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x6C,0x08, 0x1F,0xF8,0x3F,0xF8,0x7F,0xF0,0x0F,0xF9,0xF1,0xF0,0xFF,0x87,0xC3,0xC4,0x6C,0x08, 0x0E,0x7C,0x1E,0xFC,0x38,0xF8,0x3E,0xF8,0xE0,0xE0,0x1C,0x03,0xC1,0x84,0x66,0x08, 0x0E,0x1E,0x1C,0x3C,0x38,0x38,0x38,0x38,0xE0,0xE0,0x1C,0x03,0xE1,0x84,0x66,0x08, 0x0E,0x1E,0x1C,0x1C,0x38,0x18,0x78,0x38,0xE0,0xE0,0x1C,0x03,0xE1,0x82,0x63,0x10, 0x0E,0x0E,0x1C,0x1C,0x38,0x00,0xF0,0x18,0xE0,0xE0,0x1C,0x03,0xF1,0x81,0xF3,0xA0, 0x0E,0x0E,0x1C,0x3C,0x38,0xC0,0xF0,0x00,0xE0,0xE0,0x1C,0x03,0xF1,0x81,0x80,0x60, 0x0E,0x1E,0x1C,0x3C,0x38,0xC0,0xF0,0x00,0xE0,0xE0,0x1C,0x03,0x79,0x80,0x40,0x80, 0x0E,0x1E,0x1C,0xF8,0x39,0xC0,0xE0,0x00,0xE0,0xE0,0x1C,0x03,0x79,0x80,0x3F,0x00, 0x0E,0x7C,0x1F,0xF0,0x3F,0xC0,0xE0,0x00,0xFF,0xE0,0x1C,0x03,0x3D,0x80,0x00,0x00, 0x0F,0xF8,0x1D,0xE0,0x39,0xC0,0xE0,0x00,0xE0,0xE0,0x1C,0x03,0x3D,0x80,0x00,0x00, 0x0E,0x00,0x1D,0xE0,0x38,0xC0,0xE0,0x00,0xE0,0xE0,0x1C,0x03,0x1F,0x80,0x00,0x00, 0x0E,0x00,0x1C,0xF0,0x38,0xC0,0xF0,0x00,0xE0,0xE0,0x1C,0x03,0x1F,0x80,0x00,0x00, 0x0E,0x00,0x1C,0xF0,0x38,0x00,0xF0,0x00,0xE0,0xE0,0x1C,0x03,0x0F,0x80,0x00,0x00, 0x0E,0x00,0x1C,0x78,0x38,0x00,0xF0,0x18,0xE0,0xE0,0x1C,0x03,0x0F,0x80,0x00,0x00, 0x0E,0x00,0x1C,0x78,0x38,0x18,0x70,0x38,0xE0,0xE0,0x1C,0x03,0x07,0x80,0x00,0x00, 0x0E,0x00,0x1C,0x78,0x38,0x38,0x78,0x30,0xE0,0xE0,0x1C,0x03,0x07,0x80,0x00,0x00, 0x0E,0x00,0x1C,0x3C,0x38,0xF8,0x3E,0xF0,0xE0,0xE0,0x1C,0x03,0x03,0x80,0x00,0x00, 0x1F,0x00,0x3E,0x3E,0x7F,0xF0,0x1F,0xE1,0xF1,0xF0,0xFF,0x87,0x83,0x80,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,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,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0xF0,0x38,0x00,0x00,0x78,0x00,0x00,0x18,0x07,0x80,0x1C,0x03,0x80,0x00, 0x00,0x00,0x7C,0x7C,0x00,0x00,0x78,0x00,0x00,0x7C,0x07,0x80,0x1C,0x03,0xC0,0x00, 0x00,0x00,0x3C,0x70,0x00,0x00,0x70,0x00,0x07,0xFC,0x07,0x00,0x1C,0x03,0x80,0x00, 0x00,0x00,0x1C,0xE3,0xC0,0x00,0x70,0x00,0x1F,0xE1,0xC7,0x00,0x1C,0x03,0x80,0x00, 0x00,0x0F,0xFF,0xFF,0xE0,0x00,0x70,0x00,0x00,0xE1,0xE7,0x00,0x1C,0x03,0x80,0x00, 0x00,0x06,0x1C,0xE6,0x00,0xFF,0xFF,0xFC,0x00,0xE0,0xF7,0x00,0x1D,0x83,0x9E,0x00, 0x00,0x07,0x1C,0xE7,0x80,0xFF,0xFF,0xFC,0x00,0xE0,0xF7,0x03,0xFF,0xFF,0xFE,0x00, 0x00,0x03,0x9C,0xEF,0x80,0xE0,0x70,0x38,0x00,0xEE,0x67,0x00,0x1C,0x03,0x80,0x00, 0x00,0x03,0xDC,0xEE,0x00,0xE0,0x70,0x38,0x3F,0xFE,0x07,0x00,0x1C,0x03,0x80,0x00, 0x00,0x01,0xFC,0xFC,0x00,0xE0,0x70,0x38,0x01,0xE0,0x07,0x00,0x1C,0x03,0x80,0x00, 0x00,0x01,0xDC,0xF8,0xE0,0xE0,0x70,0x38,0x01,0xE1,0xC7,0x00,0x1D,0xC3,0xB8,0x00, 0x00,0x3F,0xFF,0xFF,0xF0,0xE0,0x70,0x38,0x03,0xF1,0xE7,0x00,0x1F,0xFF,0xFC,0x00, 0x00,0x3F,0xFF,0xFF,0xF0,0xE0,0x70,0x38,0x03,0xFC,0xE7,0x00,0x7E,0x38,0x38,0x00, 0x00,0x00,0x80,0x0C,0x00,0xFF,0xFF,0xF8,0x07,0xFE,0xE7,0xE3,0xFC,0x18,0x78,0x00, 0x00,0x00,0xFF,0xFE,0x00,0xE0,0x70,0x38,0x07,0xFE,0x07,0xF3,0xFC,0x1C,0x70,0x00, 0x00,0x00,0xFF,0xFE,0x00,0xE0,0x70,0x38,0x0F,0xEC,0x3F,0xC1,0x9C,0x1C,0xF0,0x00,
0x00,0x00,0xE0,0x1E,0x00,0x00,0x70,0x00,0x0E,0xE7,0xFF,0x00,0x1C,0x0E,0xE0,0x00, 0x00,0x00,0xE0,0x1E,0x00,0x00,0x70,0x00,0x1C,0xEF,0x07,0x00,0x1C,0x0F,0xE0,0x00, 0x00,0x00,0xFF,0xFE,0x00,0x00,0x70,0x00,0x38,0xE0,0x07,0x00,0x1C,0x07,0xC0,0x00, 0x00,0x00,0xE0,0x1E,0x00,0x00,0x70,0x00,0x30,0xE0,0x07,0x00,0x1C,0x07,0x80,0x00, 0x00,0x00,0xE0,0x1E,0x00,0x00,0x70,0x00,0x00,0xE0,0x07,0x00,0x1C,0x0F,0xE0,0x00, 0x00,0x00,0xE0,0x1E,0x00,0x00,0x70,0x00,0x00,0xE0,0x07,0x01,0xDC,0x3F,0xF8,0x00, 0x00,0x00,0xFF,0xFE,0x00,0x00,0x70,0x00,0x00,0xE0,0x07,0x01,0xFC,0x78,0xFF,0x00, 0x00,0x00,0xE0,0x1E,0x00,0x00,0x70,0x00,0x00,0xE0,0x07,0x00,0x7F,0xE0,0x3F,0x00, 0x00,0x00,0xC0,0x1C,0x00,0x00,0x70,0x00,0x00,0xC0,0x07,0x00,0x37,0x80,0x0C,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC, 0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
//--声明全局函数--//
void Delay10ms(unsigned int c); //延时10ms
/*******************************************************************************
* 函 数 名 : main
* 函数功能 : 主函数
* 输 入 : 无
* 输 出 : 无
*******************************************************************************/
void main()
{
while(1)
{
LCD12864_DrowPic(&Photo1[0]);
Delay10ms(500);
LCD12864_DrowPic(&Photo2[0]);
Delay10ms(500);
}
}
/*******************************************************************************
* 函 数 名 : Delay10ms
* 函数功能 : 延时函数,延时10ms
* 输 入 : 无
* 输 出 : 无
*******************************************************************************/
void Delay10ms(unsigned int c) //误差 0us
{
unsigned char a, b;
//--c已经在传递过来的时候已经赋值了,所以在for语句第一句就不用赋值了--// for (;c>0;c--)
{
for (b=38;b>0;b--)
{
for (a=130;a>0;a--);
}
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////以下是被调文件 lcd12864.c 的内容
#include<reg51.h>
#include"lcd12864.h"
//---图片代码---//
unsigned char code Photo1[] ={
0x00,0x00,0x00,0x04,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,0x01,0x3F,0xC0,
0x80,0x42,0x04,0x20,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x8A,0x1F,
0xFC,0x42,0x04,0xF8,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x80,
0x01,0xFF,0xDE,0x88,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x01,0x2A,0x87,
0xF0,0xA2,0x0A,0xF8,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xBF,0x84,
0x10,0xA2,0x0A,0x88,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x1F,
0xFC,0xA2,0x0A,0xF8,0x00,0x00,0x00,0x00,
0x05,0x2F,0xCA,0xA4,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x03,
0xE1,0xA8,0x4A,0xA8,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xBF,0xC2,
0x24,0x48,0x44,0x90,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x92,0x84,
0x24,0xA8,0x4A,0xA8,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xA6,0x58,
0x3D,0x0F,0xD0,0xC4,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x1C,0xFF,0xC0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x23,0x08,0x37,0x80,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x40,0x10,0x08,0x40,0x00,0xFF,0x90,
0x10,0x08,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x81,0x86,0x10,0x40,0x00,0x08,0x08,
0x10,0xFF,0x86,0x00,0x00,0x00,0x00,0x00,
0x01,0x02,0x49,0x40,0x40,0x00,0x7F,0x0B,
0xFC,0x08,0x0F,0x00,0x00,0x00,0x00,0x00,
0x01,0x08,0x00,0x40,0x20,0x00,0x10,0x00,
0x10,0x49,0x0F,0x00,0x00,0x00,0x00,0x00,
0x02,0x08,0x00,0x20,0x20,0x01,0xFF,0xDD,
0x10,0x2A,0x0F,0x00,0x00,0x00,0x00,0x00,
0x04,0x31,0x83,0x20,0x20,0x00,0x20,0x04,
0x91,0xFF,0xC6,0x00,0x00,0x00,0x00,0x00,
0x04,0x52,0x44,0x90,0x20,0x00,0x7F,0x04,
0x90,0x1C,0x06,0x00,0x00,0x00,0x00,0x00,
0x09,0xA4,0x28,0x4C,0x10,0x00,0xA1,0x04,
0x10,0x2A,0x00,0x00,0x00,0x00,0x00,0x00,
0x0E,0x44,0xE9,0xC3,0x90,0x01,0x3F,0x04,
0x70,0x49,0x06,0x00,0x00,0x00,0x00,0x00,
0x00,0x82,0xC5,0x81,0x70,0x00,0x21,0x0A,
0x01,0x88,0xC6,0x00,0x00,0x00,0x00,0x00,
0x01,0x01,0x83,0x00,0x80,0x00,0x3F,0x11,
0xFC,0x08,0x00,0x00,0x00,0x00,0x00,0x00,
0x01,0x0C,0x70,0x00,0x80,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x02,0x13,0x87,0x10,0x40,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x02,0x20,0x78,0xA0,0x40,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x02,0x21,0x80,0x60,0x40,0x00,0x00,0x71,
0xEE,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,
0x01,0x11,0x98,0x90,0x80,0x00,0x00,0x8E,
0x31,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,
0x01,0x08,0x18,0x80,0x80,0x00,0x01,0x24,
0x24,0x83,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x96,0x01,0x01,0x00,0x00,0x01,0x40,
0x28,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x49,0x86,0x03,0x00,0x00,0x01,0x40,
0x28,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x34,0x78,0x8C,0x00,0x00,0x01,0x00,
0x20,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x0E,0x01,0x30,0x00,0x00,0x00,0x80,
0x30,0x06,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x71,0x87,0xCE,0x00,0x00,0x00,0x40,
0x68,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xE0,0x78,0x07,0x00,0x00,0x00,0x20,
0xC4,0x18,0x00,0x00,0x00,0x00,0x00,0x00,
0x01,0xAF,0xFF,0xC5,0x80,0x00,0x00,0x11,
0x82,0x30,0x00,0x00,0x00,0x00,0x00,0x00,
0x03,0xA9,0xB6,0x45,0xC0,0x00,0x00,0x0B,
0x01,0x60,0x00,0x00,0x00,0x00,0x00,0x00,
0x07,0x2F,0x03,0xC4,0xE0,0x00,0x00,0x06,
0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,
0x0E,0x16,0x01,0x88,0x70,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x0F,0x08,0x00,0x10,0xF0,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x0F,0x84,0x00,0x21,0xF0,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,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,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,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,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,
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,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
/******************************************************************************/
unsigned char code Photo2[] ={
/*-- 调入了一幅图像:G:\HC-6800\12864\C语言\pz.bmp --*/
/*-- 宽度x高度=128x64 --*/
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,0x3F,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x80, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFE,0x60, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x63,0x20, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x63,0x10, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x63,0x08, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x7E,0x08, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x6C,0x08, 0x1F,0xF8,0x3F,0xF8,0x7F,0xF0,0x0F,0xF9,0xF1,0xF0,0xFF,0x87,0xC3,0xC4,0x6C,0x08, 0x0E,0x7C,0x1E,0xFC,0x38,0xF8,0x3E,0xF8,0xE0,0xE0,0x1C,0x03,0xC1,0x84,0x66,0x08, 0x0E,0x1E,0x1C,0x3C,0x38,0x38,0x38,0x38,0xE0,0xE0,0x1C,0x03,0xE1,0x84,0x66,0x08, 0x0E,0x1E,0x1C,0x1C,0x38,0x18,0x78,0x38,0xE0,0xE0,0x1C,0x03,0xE1,0x82,0x63,0x10,
正在阅读:
高考文言文资料03-08
三好学生评语【优秀10篇】03-23
浙江省首届中小学体育教师教学技能比赛规程03-02
高考语文复习资料:高中语文文言文实词120个全汇总-一定要收藏 -03-08
我国中小学图书馆发展新趋势03-26
高考语文复习资料:高中语文文言文实词120个全汇总,一定要收藏03-08
2017高考语文试卷真题汇编之文言文阅读01-12
在“工商企业通”项目启动暨战略合作签约仪式上的讲话08-23
《土质学与土力学》考试习题库及答案04-29
- exercise2
- 铅锌矿详查地质设计 - 图文
- 厨余垃圾、餐厨垃圾堆肥系统设计方案
- 陈明珠开题报告
- 化工原理精选例题
- 政府形象宣传册营销案例
- 小学一至三年级语文阅读专项练习题
- 2014.民诉 期末考试 复习题
- 巅峰智业 - 做好顶层设计对建设城市的重要意义
- (三起)冀教版三年级英语上册Unit4 Lesson24练习题及答案
- 2017年实心轮胎现状及发展趋势分析(目录)
- 基于GIS的农用地定级技术研究定稿
- 2017-2022年中国医疗保健市场调查与市场前景预测报告(目录) - 图文
- 作业
- OFDM技术仿真(MATLAB代码) - 图文
- Android工程师笔试题及答案
- 生命密码联合密码
- 空间地上权若干法律问题探究
- 江苏学业水平测试《机械基础》模拟试题
- 选课走班实施方案
- 汉字
- 画图
- 单片机
- 常用
- 显示
- 12864
- 南京财经大学南京财经大学814管理学综合2012考研试题研究生入学考试试题考研真题
- 浙江高校接受国内访问学者导师和专业一览表-浙江师范大学
- 2014届高三数学一轮复习专讲专练:2.10函数模型及其应用
- 杜能农业区位论
- 聚类分析论文
- 第二章电气安全技术课程讲义
- 2016-2017年最新人教版新课标小学数学六年级下册第三单元比例练精选习题(精品)
- 北京住房公积金提取申请书
- 2016-2020年不锈钢焊接钢管市场深度调研及投资战略咨询报告
- 2.4G无线鼠标及RF接收器原理图
- 看图猜明星答案及图片 看图猜明星全部名字答案
- 小型汽轮机拖动热电厂给水泵的节能分析及应用
- 丰泽区志灵汽车配件经营部企业信息报告-天眼查
- 档案高级职称评审工作总结本人XXX
- 榆林市高科建设工程质量检测中心
- 最新园林绿化工程师测试题
- 新理念英语学习大厅第四册听说测试答案
- 苏教版四年级牛津小学英语4A第一、二单元测试卷
- 剑桥雅思真题1下载TEST2阅读(Passage2)
- 2018年公需科目考试“一带一路”选择题