RaspberrPi project source code
guowenxue
2023-08-26 d6b4a750258b34c79e3c643595a0ae1cb0e18bed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*********************************************************************************
 *      Copyright:  (C) 2023 LingYun IoT System Studio
 *                  All rights reserved.
 *
 *       Filename:  sht20.c
 *    Description:  This file is temperature and relative humidity sensor SHT20 code
 *
 *        Version:  1.0.0(10/08/23)
 *         Author:  Guo Wenxue <guowenxue@gmail.com>
 *      ChangeLog:  1, Release initial version on "10/08/23 17:52:00"
 *
 * Pin connection:
 *               STH20 Module            Raspberry Pi Board
 *                   VCC      <----->      #Pin1(3.3V)
 *                   SDA      <----->      #Pin3(SDA, BCM GPIO2)
 *                   SCL      <----->      #Pin5(SCL, BCM GPIO3)
 *                   GND      <----->      GND
 *
 * /boot/config.txt:
 *                  dtoverlay=i2c1,pins_2_3
 *
 ********************************************************************************/
 
 
#ifndef  _SHT20_H_
#define  _SHT20_H_
 
#define SHT20_I2CDEV           "/dev/i2c-1"
#define SHT20_I2CADDR          0x40
 
extern int sht2x_get_temp_humidity(float *temp, float *rh);
 
#endif   /* ----- #ifndef _SHT20_H_  ----- */