@@ -290,11 +290,9 @@ def all_channels(self):
290
290
"""The current readings for all six ADC channels"""
291
291
292
292
self ._configure_f1_f4 ()
293
- self ._wait_for_data ()
294
293
low_channel_reads = self ._all_channels
295
294
296
295
self ._configure_f5_f8 ()
297
- self ._wait_for_data ()
298
296
high_channel_reads = self ._all_channels
299
297
300
298
return low_channel_reads + high_channel_reads
@@ -303,56 +301,48 @@ def all_channels(self):
303
301
def channel_415nm (self ):
304
302
"""The current reading for the 415nm band"""
305
303
self ._configure_f1_f4 ()
306
- self ._wait_for_data ()
307
304
return self ._channel_0_data
308
305
309
306
@property
310
307
def channel_445nm (self ):
311
308
"""The current reading for the 445nm band"""
312
309
self ._configure_f1_f4 ()
313
- self ._wait_for_data ()
314
310
return self ._channel_1_data
315
311
316
312
@property
317
313
def channel_480nm (self ):
318
314
"""The current reading for the 480nm band"""
319
315
self ._configure_f1_f4 ()
320
- self ._wait_for_data ()
321
316
return self ._channel_2_data
322
317
323
318
@property
324
319
def channel_515nm (self ):
325
320
"""The current reading for the 515nm band"""
326
321
self ._configure_f1_f4 ()
327
- self ._wait_for_data ()
328
322
return self ._channel_3_data
329
323
330
324
@property
331
325
def channel_555nm (self ):
332
326
"""The current reading for the 555nm band"""
333
327
self ._configure_f5_f8 ()
334
- self ._wait_for_data ()
335
328
return self ._channel_0_data
336
329
337
330
@property
338
331
def channel_590nm (self ):
339
332
"""The current reading for the 590nm band"""
340
333
self ._configure_f5_f8 ()
341
- self ._wait_for_data ()
342
334
return self ._channel_1_data
343
335
344
336
@property
345
337
def channel_630nm (self ):
346
338
"""The current reading for the 630nm band"""
347
339
self ._configure_f5_f8 ()
348
- self ._wait_for_data ()
349
340
return self ._channel_2_data
350
341
351
342
@property
352
343
def channel_680nm (self ):
353
344
"""The current reading for the 680nm band"""
354
345
self ._configure_f5_f8 ()
355
- self ._wait_for_data ()
356
346
return self ._channel_3_data
357
347
358
348
def _wait_for_data (self , timeout = 1.0 ):
@@ -392,6 +382,7 @@ def _configure_f1_f4(self):
392
382
# Enable SP_EN bit
393
383
self ._color_meas_enabled = True
394
384
self ._low_channels_configured = True
385
+ self ._wait_for_data ()
395
386
396
387
def _configure_f5_f8 (self ):
397
388
"""Configure the sensor to read from elements F5-F8, Clear, and NIR"""
@@ -414,7 +405,8 @@ def _configure_f5_f8(self):
414
405
415
406
# Enable SP_EN bit
416
407
self ._color_meas_enabled = True
417
- self ._high_channels_configured = False
408
+ self ._high_channels_configured = True
409
+ self ._wait_for_data ()
418
410
419
411
@property
420
412
def flicker_detected (self ):
@@ -448,7 +440,6 @@ def flicker_detection_enabled(self, flicker_enable):
448
440
449
441
def _f1f4_clear_nir (self ):
450
442
"""Configure SMUX for sensors F1-F4, Clear and NIR"""
451
-
452
443
self .set_smux (SMUX_IN .NC_F3L , SMUX_OUT .DISABLED , SMUX_OUT .ADC2 )
453
444
self .set_smux (SMUX_IN .F1L_NC , SMUX_OUT .ADC0 , SMUX_OUT .DISABLED )
454
445
self .set_smux (SMUX_IN .NC_NC0 , SMUX_OUT .DISABLED , SMUX_OUT .DISABLED )
0 commit comments