-
Notifications
You must be signed in to change notification settings - Fork 255
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
TCS34725 and TCS3400 support #131
Conversation
Detects the used sensor. so the same code supports both. TCS3400 is used for the Sense Hat V2 while the (discontinued) TCS34725 is used on the AstroPi sense hat for the ISS. ALso a bug fix for the computation of the red_raw, green_raw, blue_raw and clear_raw values. The original code ony fetched the LSB.
Thanks very much for this - I need to acquire a sense hat with the TCS3400 so that I can test this PR. Hopefully that will be soon |
@G3zz Just FYI tested myself on Sense Hat v2 (with TCS3400) and Sense Hat V1 (wthout colour sensor). |
Thank you. I should have acquired a TCS3400 HAT by next week, I hope - so I should be able to test all three HAT versions next week. |
I guess the colour sensor also ought to be mentioned on https://github.com/astro-pi/python-sense-hat/blob/master/README.md ? |
I had a very hard time getting hold of a TCS3400 HAT in the end, as I kept getting sent one with a TCS34725 version... |
|
||
# Set type specific constants | ||
# Assume TCS3472x as in AstroPi | ||
sensor == 'TCS3472x' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this line (with a double-equals but no if
) redundant?
Detects the used sensor. so the same code supports both. TCS3400 is used for the Sense Hat V2 while the (discontinued) TCS34725 is used on the AstroPi sense hat for the ISS.
Also included a bug fix for the computation of the red_raw, green_raw, blue_raw and clear_raw values. The original code ony fetched the LSB, not the complete 16-bit value.
See also issue #126