- 1、本文档被系统程序自动判定探测到侵权嫌疑,本站暂时做下架处理。
- 2、如果您确认为侵权,可联系本站左侧在线QQ客服请求删除。我们会保证在24小时内做出处理,应急电话:400-050-0827。
- 3、此文档由网友上传,因疑似侵权的原因,本站不提供该文档下载,只提供部分内容试读。如果您是出版社/作者,看到后可认领文档,您也可以联系本站进行批量认领。
查看更多
sht11驱动(SHT11 drive)
sht11驱动(SHT11 drive)
/************* port definition ********************
P1.0------SCK (SHT10)
P1.1------DATA (SHT10)
P0------DB0 to DB7 (LCD1602)
P2.0------RS (LCD1602)
P2.1------RW (LCD1602)
P2.2------E (LCD1602)
*****************************************/
#include reg52.h
#include intrins.h
#include stdio.h
#include string.h
#include absacc.h
#include math.h
#define uchar unsigned char
#define uint unsigned int
//1602 LCD port definition Tiananmen
Sbit LcdRs= P3^0;
Sbit LcdRw= P3^1;
Sbit LcdEn= P3^2;
Sbit ACC0 = ACC^0;
Sbit ACC7 = ACC^7;
Uchar str[7];
/ / write commands or data ************************************************************ to LCD
#define LCD_COMMAND 0 / Command
#define LCD_DATA 1 / Data
#define LCD_CLEAR_SCREEN / / 0x01 screen
#define LCD_HOMING 0x02 / / cursor return to the origin
/ / set the display mode ************************************************************
#define LCD_SHOW 0x04 / / show
#define LCD_HIDE 0x00 / / display off
#define LCD_CURSOR / / 0x02 cursor
#define LCD_NO_CURSOR 0x00 / / no cursor
#define LCD_FLASH / / 0x01 cursor flashing
#define LCD_NO_FLASH 0x00 / / cursor flashing
/ / set the input mode ************************************************************
#define LCD_AC_UP 0x02
#define LCD_AC_DOWN 0x00 / / default
#define LCD_MOVE 0x01 / / picture translation
#define LCD_NO_MOVE 0x00 //default
Unsigned char LCD_Wait (void);
Void LCD_Write (bit, style, unsigned, char, input);
/***********1602 liquid crystal display subroutine ****************/
Void delay (uint z)
{
Uint, x, y;
For (x=z; x0; x--)
For (y=110; y0; y--);
}
Void LCD_Write (bit, style, unsigned, char, input)
{
LcdRs=style;
P0=input;
Delay (5);
LcdEn=1;
Delay (5);
LcdEn=0;
}
Void LCD_SetDisplay (unsigned, char, DisplayMode)
{
LCD_Write (LCD_COMMAND, 0x08|DisplayMode);
}
Void LCD_SetInput (unsigned, char, InputMode)
{
lcd_write(lcd_command,0x04 | InputMode);
}
/ /初始化液晶************************************************************
无效lcd_initial()
{
lcden = 0;
lcd_write(lc
您可能关注的文档
- 接城龙花园裙楼商铺营销策划案1(The city of dragon garden stone shops marketing plan 1).doc
- 摄像机技术指标介绍(Introduction to camera technical specifications).doc
- 摄像十二忌(Camera twelve bogey).doc
- 摄影师用光杂谈111(With the light on 111 photographers).doc
- 摆地摊选货、进货的经验技巧(Placing goods and purchasing experience in booth).doc
- 撒发货i(Sprinkle shipment I).doc
- 撤消街道办的几点建议(Some suggestions for winding up the streets).doc
- 撤点并校不宜一刀切 山区孩子上学将更难(Point out and school should not be one size fits all, mountain children will be more difficult to go to school).doc
- 摄影测量与遥感学专业术语中英文对照(Photogrammetry and remote sensing technical terms in Chinese and English).doc
- 操作码助记符(Opcode mnemonic).doc
- shtii(shtii).doc
- siemens系统的故障诊断与维修(Fault diagnosis and maintenance of Siemens system).doc
- si硅的色散曲线(Dispersion curves of Si silicon).doc
- sketchupbbs·快捷键列表查看(sketchupbbs·快捷键列表查看).doc
- smt介绍(SMT introduction).doc
- soho(在家上班族).doc
- socket编程机制(socket编程机制).doc
- solidworks 使用心得(SolidWorks usage experience).doc
- solidworks 乱码解决(SolidWorks乱码解决).doc
- raid0、raid1、raid0+1、raid5原理介绍(The principles of raid0, RAID1, raid0+1 and RAID5 are introduced).doc
文档评论(0)