|
21 | 21 |
|
22 | 22 | **Software and Dependencies:**
|
23 | 23 |
|
24 |
| -* Adafruit CircuitPython firmware for the ESP8622 and M0-based boards: |
25 |
| - https://github.com/adafruit/circuitpython/releases |
26 |
| -* Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice |
| 24 | +* Adafruit CircuitPython firmware for the supported boards: |
| 25 | + https://circuitpython.org/downloads |
| 26 | +
|
| 27 | + * Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice |
27 | 28 | """
|
28 | 29 | from micropython import const
|
29 | 30 |
|
|
79 | 80 |
|
80 | 81 | class TSL2591:
|
81 | 82 | """TSL2591 high precision light sensor.
|
82 |
| - :param busio.I2C i2c: The I2C bus connected to the sensor |
83 |
| - :param int address: The I2C address of the sensor. If not specified |
84 |
| - the sensor default will be used. |
| 83 | +
|
| 84 | + :param ~busio.I2C i2c: The I2C bus the device is connected to |
| 85 | + :param int address: The I2C device address. Defaults to :const:`0x29` |
| 86 | +
|
| 87 | +
|
| 88 | + **Quickstart: Importing and using the device** |
| 89 | +
|
| 90 | + Here is an example of using the :class:`TSL2591` class. |
| 91 | + First you will need to import the libraries to use the sensor |
| 92 | +
|
| 93 | + .. code-block:: python |
| 94 | +
|
| 95 | + import board |
| 96 | + import adafruit_tsl2591 |
| 97 | +
|
| 98 | + Once this is done you can define your `board.I2C` object and define your sensor object |
| 99 | +
|
| 100 | + .. code-block:: python |
| 101 | +
|
| 102 | + i2c = board.I2C() # uses board.SCL and board.SDA |
| 103 | + sensor = adafruit_tsl2591.TSL2591(i2c) |
| 104 | +
|
| 105 | + Now you have access to the :attr:`lux`, :attr:`infrared` |
| 106 | + :attr:`visible` and :attr:`full_spectrum` attributes |
| 107 | +
|
| 108 | + .. code-block:: python |
| 109 | +
|
| 110 | + lux = sensor.lux |
| 111 | + infrared = sensor.infrared |
| 112 | + visible = sensor.visible |
| 113 | + full_spectrum = sensor.full_spectrum |
| 114 | +
|
85 | 115 | """
|
86 | 116 |
|
87 | 117 | # Class-level buffer to reduce memory usage and allocations.
|
@@ -229,7 +259,11 @@ def visible(self):
|
229 | 259 | @property
|
230 | 260 | def lux(self):
|
231 | 261 | """Read the sensor and calculate a lux value from both its infrared
|
232 |
| - and visible light channels. Note: ``lux`` is not calibrated! |
| 262 | + and visible light channels. |
| 263 | +
|
| 264 | + .. note:: |
| 265 | + :attr:`lux` is not calibrated! |
| 266 | +
|
233 | 267 | """
|
234 | 268 | channel_0, channel_1 = self.raw_luminosity
|
235 | 269 |
|
|
0 commit comments