Skip to content

Commit 3e8f276

Browse files
author
Mariusz Karpiarz
committed
Add code reading RGB values from the light sensor
1 parent ebbf343 commit 3e8f276

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

rpi/test_ambient.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,11 @@ def intH(channel):
2525
while True:
2626
sleep(0.25)
2727
val = apds.readAmbientLight()
28+
r = apds.readRedLight()
29+
g = apds.readGreenLight()
30+
b = apds.readBlueLight()
2831
if val != oval:
29-
print("AmbientLight={}".format(val))
32+
print("AmbientLight={} (R: {}, G: {}, B: {})".format(val, r, g, b))
3033
oval = val
3134

3235
finally:

0 commit comments

Comments
 (0)