Open dkurok opened 3 years ago
Yeah. Duplicate of #126
Problem is: this scaling is integral part of the LWP. I did not realize at the beginning which led to the unfortunate decision to have input data type == output data type. We will fix this by making the output a double. Decimal might be another choice but has a price on memory.
This is by the way the trigger for the v4 release in the first place.
Wow. Sorry. Completely misread this thread. Good question. Well, same answer... We implement first of all LWP and powered up devices. They create a 1024 discrete color spectrum. Do I like it. Nope. Is a helper method maybe useful? Maybe. Will the endpoint use 1024 for the si endpoint? Yes
Same story for other color sensors btw
Yeah, I noticed that behavior too.
I added that in my PR for the docs repo.
Good First Issue:
Create an extension method which translates the 0-1000 value to a realistic RGB scale from 0-255.
I've played arround with the ColorDistanceSensor-implementation from @highstreeto today. Using the ExampleColorDistanceSensor.cs and have it run a little bit longer in await TestMode(colorDistSensor, colorDistSensor.ModeIndexRgb) for better checking what it returns, I mentioned that it receives red, green and blue values GREATER than 255! (try over a clear white surface for getting fast to it). The "SharpBrick.PoweredUp.Cli.exe device list" gives this for the RGB-sensor Mode 6: Name: RGB I, Symbol: RAW, Capability: Input