RGB calculation in Arduino colorview.ino example incorrect
codinghead opened this issue · 1 comments
codinghead commented
-
Arduino board: ALL
-
Arduino IDE version (found in Arduino -> About Arduino menu): ALL
-
List the steps to reproduce the problem below (if possible attach a sketch or
copy the sketch code in too):
When holding a white piece of paper in front of the sensor, the "RGB" hexadecimal value generated is sometimes "100100100".
Issue lies in line 36 in "colorview.ino" sketch - r, g and b values should be multiplied by 255 (0xFF) instead of 256 (0x100).
This has been tested and this change works. It is backed up by the "colorview.pde" sketch for processing that also uses 255 as the multiplier (see lines 73 - 75)
hoffmannjan commented
Fixed - we now use getRGB
in colorview.ino
and It returns proper values.