microsoft / pxt-ev3

Microsoft MakeCode editor for the LEGO MINDSTORMS EV3 Brick
https://makecode.mindstorms.com/
Other
55 stars 39 forks source link

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

Closed THEb0nny closed 1 year ago

THEb0nny commented 1 year ago

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 commented 1 year ago

Before image

After the changes image image image image image

THEb0nny commented 1 year ago

@jwunderl please see changes

THEb0nny commented 1 year ago

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.

jwunderl commented 1 year ago

Thanks!