Skip to content
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

Added support for Reflection Raw mode for the color sensor to the simulator #1017

Merged
merged 2 commits into from
May 5, 2023

Conversation

THEb0nny
Copy link
Contributor

@THEb0nny THEb0nny commented May 3, 2023

Code that adds reflection raw support for the color sensor. The range of values for this is from 0 to 1023, because analog to digital converter is 10 bits. In fact, the color sensor gives values ​​of about 400 - 700, but I decided to leave the range, which could theoretically be. For other cases (reflections and ambient lighting), the range remains from 0 to 100. The average value when setting the mode in the simulator is displayed as 512, for other modes 50%.

Code that adds reflection raw support for the color sensor. The range of values for this is from 0 to 1023, because analog to digital converter is 10 bits. In fact, the color sensor gives values ​​of about 400 - 700, but I decided to leave the range, which could theoretically be. For other cases (reflections and ambient lighting), the range remains from 0 to 100. The average value when setting the mode in the simulator is displayed as 512, for other modes 50%.
@THEb0nny
Copy link
Contributor Author

THEb0nny commented May 3, 2023

Before
image

After the changes
image
image
image
image
image

@THEb0nny
Copy link
Contributor Author

THEb0nny commented May 3, 2023

@jwunderl please see changes

@THEb0nny
Copy link
Contributor Author

THEb0nny commented May 3, 2023

Next, I plan to make support for RgbRaw, there you will need to make three sliders for R G B components separately...
But this will be a separate change request.

Block description update, as it did not take into account the mode of raw reflection values.
@jwunderl jwunderl merged commit 9be35a1 into microsoft:master May 5, 2023
@jwunderl
Copy link
Member

jwunderl commented May 5, 2023

Thanks!

@THEb0nny THEb0nny deleted the ref-raw-sim-support branch May 6, 2023 10:17
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.

2 participants