File tree 1 file changed +34
-3
lines changed 1 file changed +34
-3
lines changed Original file line number Diff line number Diff line change 15
15
16
16
**Hardware:**
17
17
18
- * Adafruit SGP40 Breakout <https://www.adafruit.com/product/4829>
18
+ * Adafruit SGP40 Air Quality Sensor Breakout - VOC Index <https://www.adafruit.com/product/4829>
19
19
20
20
**Software and Dependencies:**
21
21
22
22
* Adafruit CircuitPython firmware for the supported boards:
23
23
https://github.com/adafruit/circuitpython/releases
24
24
25
25
26
-
27
26
* Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
28
27
* Adafruit's Register library: https://github.com/adafruit/Adafruit_CircuitPython_Register
29
28
41
40
42
41
43
42
class SGP40 :
44
- """Class to use the SGP40 Ambient Light and UV sensor"""
43
+ """
44
+ Class to use the SGP40 Ambient Light and UV sensor
45
+
46
+ :param ~busio.I2C i2c: The I2C bus the SGP40 is connected to.
47
+ :param int address: The I2C address of the device. Defaults to :const:`0x59`
48
+
49
+
50
+ **Quickstart: Importing and using the SGP40 temperature sensor**
51
+
52
+ Here is one way of importing the `SGP40` class so you can use it with the name ``sgp``.
53
+ First you will need to import the libraries to use the sensor
54
+
55
+ .. code-block:: python
56
+
57
+ import busio
58
+ import board
59
+ import adafruit_sgp40
60
+
61
+ Once this is done you can define your `busio.I2C` object and define your sensor object
62
+
63
+ .. code-block:: python
64
+
65
+ i2c = busio.I2C(board.SCL, board.SDA)
66
+ sgp = adafruit_sgp40.SGP40(i2c)
67
+
68
+ Now you have access to the raw gas value using the :attr:`raw` attribute
69
+
70
+ .. code-block:: python
71
+
72
+ raw_gas_value = sgp.raw
73
+
74
+
75
+ """
45
76
46
77
def __init__ (self , i2c , address = 0x59 ):
47
78
self .i2c_device = i2c_device .I2CDevice (i2c , address )
You can’t perform that action at this time.
0 commit comments