File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,8 @@ Usage Example
87
87
print("F6 - 590nm/Yellow %s" % bar_graph(sensor.channel_590nm))
88
88
print("F7 - 630nm/Orange %s" % bar_graph(sensor.channel_630nm))
89
89
print("F8 - 680nm/Red %s" % bar_graph(sensor.channel_680nm))
90
+ print("Clear %s" % bar_graph(sensor.channel_clear))
91
+ print("Near-IR (NIR) %s" % bar_graph(sensor.channel_nir))
90
92
print("\n------------------------------------------------")
91
93
sleep(1)
92
94
Original file line number Diff line number Diff line change @@ -376,7 +376,17 @@ def channel_680nm(self):
376
376
self ._configure_f5_f8 ()
377
377
return self ._channel_3_data
378
378
379
- # TODO: Add clear and NIR accessors
379
+ @property
380
+ def channel_clear (self ):
381
+ """The current reading for the clear sensor"""
382
+ self ._configure_f5_f8 ()
383
+ return self ._channel_4_data
384
+
385
+ @property
386
+ def channel_nir (self ):
387
+ """The current reading for the NIR (near-IR) sensor"""
388
+ self ._configure_f5_f8 ()
389
+ return self ._channel_5_data
380
390
381
391
def _wait_for_data (self , timeout = 1.0 ):
382
392
"""Wait for sensor data to be ready"""
Original file line number Diff line number Diff line change @@ -23,5 +23,7 @@ def bar_graph(read_value):
23
23
print ("F6 - 590nm/Yellow %s" % bar_graph (sensor .channel_590nm ))
24
24
print ("F7 - 630nm/Orange %s" % bar_graph (sensor .channel_630nm ))
25
25
print ("F8 - 680nm/Red %s" % bar_graph (sensor .channel_680nm ))
26
+ print ("Clear %s" % bar_graph (sensor .channel_clear ))
27
+ print ("Near-IR (NIR) %s" % bar_graph (sensor .channel_nir ))
26
28
print ("\n ------------------------------------------------" )
27
29
sleep (1 )
You can’t perform that action at this time.
0 commit comments