Skip to content

ZeroDivisionError: division by zero on adafruit_tcs34725.py #14

@asyzen

Description

@asyzen

On /usr/local/lib/python3.5/dist-packages/adafruit_tcs34725.py the function def color_rgb_bytes(self) should check if rgb values are greater than zero to avoid the division by zero exception

File "/usr/local/lib/python3.5/dist-packages/adafruit_tcs34725.py", line 240, in color_rgb_bytes
red = int(pow((int((r/clear) * 256) / 255), 2.5) * 255)
ZeroDivisionError: division by zero

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions