117
117
118
118
119
119
class AS726x :
120
- """AS726x spectral sensor base class.
121
-
122
- """
120
+ """AS726x spectral sensor base class."""
123
121
124
122
MODE_0 = 0b00
125
123
"""Continuously gather samples of violet, blue, green and yellow. Orange and red are skipped
@@ -204,10 +202,10 @@ def indicator_led(self, val):
204
202
def driver_led_current (self ):
205
203
"""The current limit for the driver LED in milliamps. One of:
206
204
207
- - 12.5 mA
208
- - 25 mA
209
- - 50 mA
210
- - 100 mA"""
205
+ - 12.5 mA
206
+ - 25 mA
207
+ - 50 mA
208
+ - 100 mA"""
211
209
return self ._driver_led_current
212
210
213
211
@driver_led_current .setter
@@ -226,10 +224,10 @@ def driver_led_current(self, val):
226
224
def indicator_led_current (self ):
227
225
"""The current limit for the indicator LED in milliamps. One of:
228
226
229
- - 1 mA
230
- - 2 mA
231
- - 4 mA
232
- - 8 mA"""
227
+ - 1 mA
228
+ - 2 mA
229
+ - 4 mA
230
+ - 8 mA"""
233
231
return self ._indicator_led_current
234
232
235
233
@indicator_led_current .setter
@@ -248,10 +246,10 @@ def indicator_led_current(self, val):
248
246
def conversion_mode (self ):
249
247
"""The conversion mode. One of:
250
248
251
- - `MODE_0`
252
- - `MODE_1`
253
- - `MODE_2`
254
- - `ONE_SHOT`"""
249
+ - `MODE_0`
250
+ - `MODE_1`
251
+ - `MODE_2`
252
+ - `ONE_SHOT`"""
255
253
return self ._conversion_mode
256
254
257
255
@conversion_mode .setter
@@ -300,8 +298,8 @@ def integration_time(self, val):
300
298
def start_measurement (self ):
301
299
"""Begin a measurement.
302
300
303
- This will set the device to One Shot mode and values will not change after `data_ready`
304
- until `start_measurement` is called again or the `conversion_mode` is changed."""
301
+ This will set the device to One Shot mode and values will not change after `data_ready`
302
+ until `start_measurement` is called again or the `conversion_mode` is changed."""
305
303
state = self ._virtual_read (_AS726X_CONTROL_SETUP )
306
304
state &= ~ (0x02 )
307
305
self ._virtual_write (_AS726X_CONTROL_SETUP , state )
@@ -401,8 +399,8 @@ def _virtual_write(self, addr, value):
401
399
class AS726x_I2C (AS726x ):
402
400
"""AS726x spectral sensor via I2C.
403
401
404
- :param ~busio.I2C i2c_bus: The I2C bus connected to the sensor
405
- """
402
+ :param ~busio.I2C i2c_bus: The I2C bus connected to the sensor
403
+ """
406
404
407
405
def __init__ (self , i2c_bus , address = _AS726X_ADDRESS ):
408
406
self .i2c_device = I2CDevice (i2c_bus , address )
@@ -467,8 +465,8 @@ def _virtual_write(self, addr, value):
467
465
class AS726x_UART (AS726x ):
468
466
"""AS726x spectral sensor via UART.
469
467
470
- :param ~busio.UART uart: The UART connected to the sensor
471
- """
468
+ :param ~busio.UART uart: The UART connected to the sensor
469
+ """
472
470
473
471
def __init__ (self , uart ):
474
472
self ._uart = uart
0 commit comments