|
6 | 6 | `adafruit_tcs34725`
|
7 | 7 | ====================================================
|
8 | 8 |
|
9 |
| -CircuitPython module for the TCS34725 color sensor. Ported from the |
10 |
| -micropython-adafruit-tcs34725 module by Radomir Dopieralski: |
11 |
| -https://github.com/adafruit/micropython-adafruit-tcs34725 |
| 9 | +CircuitPython module for the TCS34725 color sensor. |
| 10 | +Ported from the |
| 11 | +`micropython-adafruit-tcs34725 <https://github.com/adafruit/micropython-adafruit-tcs34725>`_ |
| 12 | +module by Radomir Dopieralski |
| 13 | +
|
12 | 14 |
|
13 | 15 | See examples/tcs34725_simpletest.py for an example of the usage.
|
14 | 16 |
|
|
27 | 29 |
|
28 | 30 | **Software and Dependencies:**
|
29 | 31 |
|
30 |
| -* Adafruit CircuitPython firmware for the ESP8622 and M0-based boards: |
31 |
| - https://github.com/adafruit/circuitpython/releases |
| 32 | +* Adafruit CircuitPython firmware for the supported boards: |
| 33 | + https://circuitpython.org/downloads |
| 34 | +
|
32 | 35 | * Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
|
33 | 36 | """
|
34 | 37 | import time
|
|
65 | 68 |
|
66 | 69 |
|
67 | 70 | class TCS34725:
|
68 |
| - """Driver for the TCS34725 color sensor.""" |
| 71 | + """Driver for the TCS34725 color sensor. |
| 72 | +
|
| 73 | + :param ~busio.I2C i2c: The I2C bus the device is connected to |
| 74 | + :param int address: The I2C device address. Defaults to :const:`0x29` |
| 75 | +
|
| 76 | +
|
| 77 | + **Quickstart: Importing and using the device** |
| 78 | +
|
| 79 | + Here is an example of using the :class:`TCS34725`. |
| 80 | + First you will need to import the libraries to use the sensor |
| 81 | +
|
| 82 | + .. code-block:: python |
| 83 | +
|
| 84 | + import board |
| 85 | + import adafruit_tcs34725 |
| 86 | +
|
| 87 | + Once this is done you can define your `board.I2C` object and define your sensor object |
| 88 | +
|
| 89 | + .. code-block:: python |
| 90 | +
|
| 91 | + i2c = board.I2C() # uses board.SCL and board.SDA |
| 92 | + sensor = adafruit_tcs34725.TCS34725(i2c) |
| 93 | +
|
| 94 | +
|
| 95 | + Now you have access to the :attr:`color_temperature`, :attr:`lux` attributes |
| 96 | +
|
| 97 | + .. code-block:: python |
| 98 | +
|
| 99 | + temp = sensor.color_temperature |
| 100 | + lux = sensor.lux |
| 101 | +
|
| 102 | +
|
| 103 | + """ |
69 | 104 |
|
70 | 105 | # Class-level buffer for reading and writing data with the sensor.
|
71 | 106 | # This reduces memory allocations but means the code is not re-entrant or
|
@@ -318,7 +353,7 @@ def _temperature_and_lux_dn40(self):
|
318 | 353 | def glass_attenuation(self):
|
319 | 354 | """The Glass Attenuation (FA) factor used to compensate for lower light
|
320 | 355 | levels at the device due to the possible presence of glass. The GA is
|
321 |
| - the inverse of the glass transmissivity (T), so GA = 1/T. A transmissivity |
| 356 | + the inverse of the glass transmissivity (T), so :math:`GA = 1/T`. A transmissivity |
322 | 357 | of 50% gives GA = 1 / 0.50 = 2. If no glass is present, use GA = 1.
|
323 | 358 | See Application Note: DN40-Rev 1.0 – Lux and CCT Calculations using
|
324 | 359 | ams Color Sensors for more details.
|
|
0 commit comments