19
19
# CircuitPython Library Author: Michael Schroeder(sommersoft). No
20
20
# affiliation to Adafruit is implied.
21
21
"""
22
- `adafruit_VEML6070 ` - VEML6070 UV Sensor
22
+ `adafruit_veml6070 ` - VEML6070 UV Sensor
23
23
====================================================
24
24
25
25
CircuitPython library to support VEML6070 UV Index sensor.
46
46
47
47
"""
48
48
49
- __version__ = "1.0 .0"
49
+ __version__ = "0.0.0-auto .0"
50
50
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_VEML6070.git"
51
51
52
52
from adafruit_bus_device .i2c_device import I2CDevice
@@ -83,19 +83,20 @@ class VEML6070:
83
83
84
84
:param i2c_bus: The `busio.I2C` object to use. This is the only required parameter.
85
85
:param str _veml6070_it: The integration time you'd like to set initially. Availble
86
- options: `VEML6070_HALF_T`, `VEML6070_1_T`, `VEML6070_2_T`, and
87
- `VEML6070_4_T`. The higher the '_x_' value, the more accurate
86
+ options: `` VEML6070_HALF_T`` , `` VEML6070_1_T`` , `` VEML6070_2_T` `, and
87
+ `` VEML6070_4_T` `. The higher the '_x_' value, the more accurate
88
88
the reading is (at the cost of less samples per reading).
89
- Defaults to `VEML6070_1_T` if parameter not passed. To change
89
+ Defaults to `` VEML6070_1_T` ` if parameter not passed. To change
90
90
setting after intialization, use
91
- `[veml6070].set_integration_time(new_it)`.
92
- :param bool ack: The inital setting of `ACKnowledge` on alert. Defaults to `False`
91
+ `` [veml6070].set_integration_time(new_it)` `.
92
+ :param bool ack: The inital setting of `` ACKnowledge`` on alert. Defaults to `` False` `
93
93
if parameter not passed. To change setting after intialization,
94
- use `[veml6070].set_ack(new_ack)`.
94
+ use `` [veml6070].set_ack(new_ack)` `.
95
95
96
96
Example:
97
97
98
98
.. code-block:: python
99
+
99
100
from board import *
100
101
import busio, veml6070, time
101
102
@@ -164,7 +165,7 @@ def set_ack(self, new_ack=False):
164
165
"""
165
166
Turns on or off the ACKnowledge function of the sensor. The ACK function will send
166
167
a signal to the host when the value of the sensed UV light changes beyond the
167
- programmed threshold. Use `[veml6070].set_ack_threshold` to change between the two
168
+ programmed threshold. Use `` [veml6070].set_ack_threshold` ` to change between the two
168
169
available threshold settings.
169
170
"""
170
171
if new_ack not in (True , False ):
@@ -178,8 +179,8 @@ def set_ack(self, new_ack=False):
178
179
def set_ack_threshold (self , new_ack_thd = 0 ):
179
180
"""
180
181
Sets the ACKnowledge Threshold, which alerts the host controller to value changes
181
- greater than the threshold. Available settings are: `0` = 102 steps; `1 ` = 145 steps.
182
- `0 ` is the default setting.
182
+ greater than the threshold. Available settings are: ``0`` = 102 steps; ``1` ` = 145 steps.
183
+ ``0` ` is the default setting.
183
184
"""
184
185
if new_ack_thd not in (0 , 1 ):
185
186
raise ValueError ("ACK Threshold must be '0' or '1'." )
@@ -194,8 +195,8 @@ def set_integration_time(self, new_it):
194
195
"""
195
196
Sets the Integration Time of the sensor. This is the refresh interval of the
196
197
sensor. The higher the refresh interval, the more accurate the reading is (at
197
- the cost of less sampling). The available settings are: `VEML6070_HALF_T`,
198
- `VEML6070_1_T`, `VEML6070_2_T`, `VEML6070_4_T`.
198
+ the cost of less sampling). The available settings are: `` VEML6070_HALF_T` `,
199
+ `` VEML6070_1_T`` , `` VEML6070_2_T`` , `` VEML6070_4_T` `.
199
200
"""
200
201
if new_it not in _VEML6070_INTEGRATION_TIME :
201
202
raise ValueError ("Integration Time invalid. Valid values are: " ,
@@ -218,7 +219,7 @@ def sleep(self):
218
219
219
220
def wake (self ):
220
221
"""
221
- Wakes the VEML6070 from sleep. `[veml6070].read` will also wake from sleep.
222
+ Wakes the VEML6070 from sleep. `` [veml6070].read` ` will also wake from sleep.
222
223
"""
223
224
self .buf [0 ] = (self ._ack << 5 | self ._ack_thd << 4 |
224
225
_VEML6070_INTEGRATION_TIME [self ._it ][0 ] << 2 | 0x02 )
@@ -227,8 +228,8 @@ def wake(self):
227
228
228
229
def get_index (self , _raw ):
229
230
"""
230
- Calculates the UV Risk Level based on the captured UV reading. Requres the `_raw`
231
- argument (from `veml6070.read`). Risk level is available for Integration Times (IT)
231
+ Calculates the UV Risk Level based on the captured UV reading. Requres the `` _raw` `
232
+ argument (from `` veml6070.read` `). Risk level is available for Integration Times (IT)
232
233
1, 2, & 4. The result is automatically scaled to the current IT setting.
233
234
234
235
LEVEL* UV Index
@@ -240,8 +241,9 @@ def get_index(self, _raw):
240
241
EXTREME >=11
241
242
242
243
* Not to be considered as accurate condition reporting.
243
- Calculation is based on VEML6070 Application Notes:
244
- http://www.vishay.com/docs/84310/designingveml6070.pdf
244
+ Calculation is based on VEML6070 Application Notes:
245
+ http://www.vishay.com/docs/84310/designingveml6070.pdf
246
+
245
247
"""
246
248
247
249
# get the divisor for the current IT
0 commit comments