File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ class HardwareInterface:
1515 actual hardware. Using this intermediate layer of abstraction, a
1616 `ColourSensor` object interacts with the hardware without being
1717 aware of how this interaction is implemented.
18-
1918 Different subclasses of the `HardwareInterface` class can provide
2019 access to the hardware through e.g. I2C, `libiio` and its system
2120 files or even a hardware emulator.
@@ -131,7 +130,6 @@ class I2C(HardwareInterface):
131130 """
132131 An implementation of the `HardwareInterface` for the TCS34725 sensor
133132 that uses I2C to control the sensor and retrieve measurements.
134-
135133 Use the datasheet as a reference: https://ams.com/tcs34725#tab/documents
136134 """
137135
@@ -351,6 +349,10 @@ def _scaling(self):
351349 def colour (self ):
352350 return tuple (reading // self ._scaling for reading in self .colour_raw )
353351
352+ @property
353+ def rgb (self ):
354+ return tuple (reading // self ._scaling for reading in self .colour_raw )[0 :3 ]
355+
354356 color = colour
355357 red = property (lambda self : self .red_raw // self ._scaling )
356358 green = property (lambda self : self .green_raw // self ._scaling )
You can’t perform that action at this time.
0 commit comments