微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > 51单片机的LCD1602液晶密码锁C语言程序

51单片机的LCD1602液晶密码锁C语言程序

时间:11-28 来源:互联网 点击:

{

write_order(0x8a);

write_date(0xc3);

write_date(0xdc);

write_date(0xc2);

write_date(0xeb);

write_date(0xd5);

write_date(0xfd);

write_date(0xc8);

write_date(0xb7);

write_date(0xa3);

write_date(0xa1);

}

void display2(void)

{

write_order(0x8a);

write_date(0xc3);

write_date(0xdc);

write_date(0xc2);

write_date(0xeb);

write_date(0xb4);

write_date(0xed);

write_date(0xce);

write_date(0xf3);

write_date(0xa3);

write_date(0xa1);

}

void display3(void)

{

write_order(0x98);

write_date(0xca);

write_date(0xe4);

write_date(0xc8);

write_date(0xeb);

write_date(0xc3);

write_date(0xdc);

write_date(0xc2);

write_date(0xeb);

write_date(0xca);

write_date(0xb1);

write_date(0xbc);

write_date(0xe4);

write_date(0xd2);

write_date(0xd1);

write_date(0xb5);

write_date(0xb9);

}

void lcd_int(void)

{ret=0;

delay(10);

ret=1;

_nop_();

psb=1;

_nop_();

}

void functionset(void)

{

write_order(0x34);

write_order(0x30);

write_order(0x01);

write_order(0x06);

write_order(0x0c);

}

void clear_lcd(void)

{

write_order(0x01);

write_order(0x34);

write_order(0x30);

}

void write_order(uchar command)

{

delay(100);

rs=0;

rw=0;

P0=command;

en=1;

_nop_();

_nop_();

en=0;

}

void write_date(uchar date)

{

delay(100);

rs=1;

rw=0;

P0=date;

en=1;

_nop_();

_nop_();

en=0;

}

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top