仿真图形
运行后结果
#ifndef __TOU_H__
#define __TOU_H__
#include
//#include
#define uchar unsigned char enum {TEMP,HUMI};
sbit DATA = P1^1; sbit SCK = P1^0;
sbit RS = P2^0; sbit RW = P2^1; sbit E = P2^2;
sfr DBPort = 0x80; //P0=0x80,P1=0x90,P2=0xA0,P3=0xB0.数据端口
/******** DS1602函数声明 ********/ void LCD_Initial();
void GotoXY(unsigned char x, unsigned char y); void Print(unsigned char *str);
void LCD_Write(bit style, unsigned char input);
/******** SHT10函数声明 ********/ void s_connectionreset(void);
char s_measure(unsigned char *p_value, unsigned char *p_checksum, unsigned char mode); void calc_sth10(float *p_humidity ,float *p_temperature); //float calc_dewpoint(float h,float t);
#endif
/***********************************************************************************************************************************************************/
//SHT10程序(SHT10.c):
//#include
#define noACK 0 //继续传输数据,用于判断是否结束通讯 #define ACK 1 //结束数据传输; //地址 命令 读/写 #define STATUS_REG_W 0x06 //000 0011 0 #define STATUS_REG_R 0x07 //000 0011 1 #define MEASURE_TEMP 0x03 //000 0001 1 #define MEASURE_HUMI 0x05 //000 0010 1