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