Skip to content

change color property to use scaled color_raw values #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

FoamyGuy
Copy link
Contributor

@FoamyGuy FoamyGuy commented May 9, 2020

Solves #18

Tested with: https://www.adafruit.com/product/1356

If I understand the docs in color_raw correctly the values should range from (0-65535). At first I tried scaling down from there to 0-255 for this but I was only getting VERY low colors or black.

I set up script to print the color_raw values and 1024 was the maximum value I observed for any color or clear channel. Most easily achieved by putting white paper in front of the sensor very close.

After adjusting the scaling to use the 1024 maximum I am seeing a good range of colors when various objects are placed in front of the sensor.

In comparison with color_rgb_bytes the colors this version returns tend to be similar but a bit brighter.

@boukeas
Copy link

boukeas commented Jun 22, 2020

If I understand the docs in color_raw correctly the values should range from (0-65535).

According to the datasheet, the range of values depends on the integration time. The maximum value ranges from 1024 to 65536. So, correct scaling to a range of 256 values needs to take the integration time into account.

@kattni
Copy link
Contributor

kattni commented Aug 17, 2020

@FoamyGuy Did you get a chance to look into the potential integration time situation with regards to your changes?

@kattni
Copy link
Contributor

kattni commented Jan 6, 2021

@FoamyGuy Are you still interested in working on this PR?

@FoamyGuy
Copy link
Contributor Author

FoamyGuy commented Jan 6, 2021

@kattni I will have to bow out of this one. Sorry I didn't realize I never came back to make a follow up post here, I should have done that.

I did try looking into the integration time information in the datasheet but I'm afraid this is a bit over my head. I'm not really sure what needs to be done in the library code based on the information in datasheet.

@jposada202020
Copy link
Contributor

So was reviewing all the information. I spent a fair amount of time looking for the explanation in the formulas in #18. But, no success, I propose that we close this PR as it will not solve the root cause of the problem, and it will not solve the issue.
Let me know your suggestions. Thanks
@kattni and @FoamyGuy

@evaherrada evaherrada changed the base branch from master to main June 7, 2021 18:46
@snkYmkrct
Copy link
Contributor

I agree with @jposada202020, I don't think these changes are necessary.
I explained my findings about the issue in #18 comments.

@kattni @FoamyGuy

@jposada202020
Copy link
Contributor

@FoamyGuy PR #37 was merged. Do you agree to close this PR?. please see comments in issue #18

@FoamyGuy
Copy link
Contributor Author

FoamyGuy commented Jul 2, 2021

Yep. Thank you @SilviaCC

@FoamyGuy FoamyGuy closed this Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants