完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
|
|
相关推荐
10个回答
|
|
放一张大一点的图看的更清一些吧。。。
|
|
|
|
没人吗。。。那么强大的一个论坛。。。
|
|
|
|
红框里面的线都不接啊。。
|
|
|
|
|
|
|
|
|
|
|
|
程序是基于STC12C5A60S2写的,实物能完美运行;可是proteus里面没有,所以我仿真是用C52搭的,这图是实物的管脚分配
|
|
|
|
#include "reg52.h" #include "typedef.h" #include "delay.h" #include "12864.h" ***it LCD_CLK = P0^5; ***it LCD_SID = P0^6; ***it LCD_CS = P0^7; xdata uchar LCD_Buf[64]=0; uchar SparkF = 0; //闪烁开关 uchar SparkA = 0; //闪烁缓存地址 uchar SparkL = 1; //闪烁长度默认1 uchar LCD_RefFlag = 0; void LCD_Write_Byte(uchar Data) //往12864写一个字节 { uchar i; for(i=0;i<8;i++) { LCD_CLK = 0; //时钟拉低 if(Data & 0x80) { LCD_SID = 1; } else { LCD_SID = 0; } LCD_CLK = 1; //时钟拉高,传入1bit数据 Data = Data<<1; //数据左移一位 } } void LCD_Write_Command(uchar COMMAND) //写控制命令 { LCD_CS = 1; LCD_Write_Byte(SENDCOMM); LCD_Write_Byte(COMMAND & 0XF0); //写入高四位 LCD_Write_Byte((COMMAND << 4) & 0XF0); //写入低四位 LCD_CS = 0; } void LCD_Write_Data(uchar Data) //写数据 { LCD_CS = 1; LCD_Write_Byte(SENDDATA); LCD_Write_Byte(Data & 0XF0); //写入高四位 LCD_Write_Byte((Data << 4)&0XF0); //写入低四位 LCD_CS = 0; } void LCD_XY(uchar x,uchar y) //设置显示位置 X(1~16),Y(1~4) { switch(y) { case 1:LCD_Write_Command(0X7F+x);break; case 2:LCD_Write_Command(0X8F+x);break; case 3:LCD_Write_Command(0X87+x);break; case 4:LCD_Write_Command(0X97+x);break; default: break; } } void LCD_Init(void) { Delay_1ms(100); LCD_Write_Command(0x34);//一次送8位数据 LCD_Write_Command(0x30);//基本操作指令 LCD_Write_Command(0x0C);//整体显示,游标off, LCD_Write_Command(0x01);//清屏 Delay_1ms(100); LCD_Clr(); } //void Display_Char(uchar x,uchar y, uchar Char) //{ // uchar add = 2*(x-1)+16*(y-1); // LCD_Buf[add]=Char; // LCD_RefFlag = 1; //} void Display_String(uchar x,uchar y,uchar *string) { uchar add = 2*(x-1)+16*(y-1); LCD_RefFlag = 0; while(*string!=' |