sht11驱动(SHT11 drive).docVIP

  1. 1、本文档被系统程序自动判定探测到侵权嫌疑,本站暂时做下架处理。
  2. 2、如果您确认为侵权,可联系本站左侧在线QQ客服请求删除。我们会保证在24小时内做出处理,应急电话:400-050-0827。
  3. 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

您可能关注的文档

文档评论(0)

jgx3536 + 关注
实名认证
文档贡献者

该用户很懒,什么也没介绍

版权声明书
用户编号:6111134150000003

1亿VIP精品文档

相关文档