📄 sht11.h
字号:
#define SETDATA( ) PORTG|=1<<PG3
#define CLRDATA( ) PORTG&=~(1<<PG3)
#define SETSCK( ) PORTG|=1<<PG4
#define CLRSCK( ) PORTG&=~(1<<PG4)
//adr command r/w
#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
#define RESET 0x1e //000 1111 0
#ifdef wenshidu_c
volatile uint shixunhuan;
volatile uchar wendu1;
volatile uchar wendu2;
volatile uchar shidu1;
volatile uchar shidu2;
volatile uchar wenxiao;
volatile uchar shixiao;
volatile uint wenduint;
volatile uint shiduint;
volatile double wenduf1;
volatile double shiduf1;
volatile double wenduf2;
volatile double shiduf2;
volatile double wenduf3;
volatile double shiduf3;
volatile double *weng;
volatile double *shig;
volatile uchar wendu3;
volatile uchar wendu4;
volatile uchar shidu3;
volatile uchar shidu4;
volatile uchar error,checksum;
//volatile uchar tongdao;
volatile double rh_lin;
volatile double rh_true;
volatile double t_C;
#endif
#ifdef wenshidu_c
char s_write_byte(unsigned char value);
char s_read_byte( );
void s_transstart(void);
void s_connectionreset(void);
char s_softreset(void);
char s_read_statusreg( );
char s_write_statusreg(unsigned char *p_value);
char s_measurewen( );
char s_measureshi( );
void calc_sth11( );
void adad();
void SHTyanshi( );
#else
extern char s_write_byte(unsigned char value);
extern char s_read_byte(unsigned char ack);
extern void s_transstart(void);
extern void s_connectionreset(void);
extern char s_softreset(void);
extern char s_read_statusreg(unsigned char *p_value, unsigned char *p_checksum);
extern char s_write_statusreg(unsigned char *p_value);
extern void s_measurewen( );
extern void s_measureshi( );
extern void calc_sth11( );
extern void adad();
extern void SHTyanshi( );
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -