adafruit / Adafruit_TCS34725

Arduino library driver for Adafruit's TCS34725 RGB Color Sensor Breakout
http://www.adafruit.com/products/1334
Other
149 stars 149 forks source link

Fix for 'Division by Null' exception and compiler warnings #31

Closed weinrank closed 5 years ago

weinrank commented 5 years ago

This PR fixes two possible 'Division by Null' cases when the r,g,b values are null which happens if the sensor operates in darkness. See #30 The calculateColorTemperature and calculateColorTemperature_dn40 functions now return with zero.

In addition, I've fixed multiple compiler warnings and removed unused variables/code.

weinrank commented 5 years ago

Anything missing to merge this PR?

ladyada commented 5 years ago

hiya you did fix some possible div0 but also deleted a bunch of code, which means we have to do a lot more work to review this PR. if you'd like to get the div0 bug fixed sooner, please submit that as a separate standalone PR!

weinrank commented 5 years ago

Okay, I'll split this in two PRs