From 3e8f27658fa909ca94b561bd5e4d9873b97cdb27 Mon Sep 17 00:00:00 2001 From: Mariusz Karpiarz Date: Mon, 7 Sep 2020 22:14:33 +0100 Subject: [PATCH] Add code reading RGB values from the light sensor --- rpi/test_ambient.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rpi/test_ambient.py b/rpi/test_ambient.py index 1e44932..a1e4c8a 100644 --- a/rpi/test_ambient.py +++ b/rpi/test_ambient.py @@ -25,8 +25,11 @@ def intH(channel): while True: sleep(0.25) val = apds.readAmbientLight() + r = apds.readRedLight() + g = apds.readGreenLight() + b = apds.readBlueLight() if val != oval: - print("AmbientLight={}".format(val)) + print("AmbientLight={} (R: {}, G: {}, B: {})".format(val, r, g, b)) oval = val finally: