/
/*
Index_Num 数组元素最大序号
Index 数组元素当前序号
Index_P 选中项序号
Index_P_Pre 上一选中项序号,用于快速清理上次所画下的图案
*/
#include
#include
#define delayNOP(); {_nop_();_nop_();_nop_();_nop_();};
#define LCD_data P0 //数据口
#define Index_Num 8
typedef unsigned char uchar;
typedef unsigned int uint;
sbit Key1 = P1^0;
sbit Key2 = P1^1;
sbit LCD_RS = P2^6; //寄存器选择输入 cs
sbit LCD_RW = P2^5; //液晶读/写控制 sid
sbit LCD_EN = P2^7; //液晶使能控制 clk
sbit LCD_PSB = P3^2; //串/并方式控制
sbit LCD_RST = P3^7; //液晶复位端口
bdata uchar DataBuf;
uint Index,Index_P_Pre;
uint Index_P=0;
uchar code Weibo[][16]={"hello","呀咦 晗昱","weibo.com","/maixianyu","blog.163.com","maixianyu@126",
"123","456","789"};
// 200us
void delay(int ms)
{
uchar t;
while(ms--)
{
for(t=0; t<20; t++) ;
}
}
//
void Lcd_Write_8bit(uchar msg){
uint i;
uchar DataBuffer;
DataBuffer=msg;
for(i=0;i<8;i++){
LCD_R