corneliusmunz / legoino

Arduino Library for controlling Powered UP and Boost controllers
MIT License
257 stars 34 forks source link

Color Sensor value for GREEN shows CYAN #43

Closed corneliusmunz closed 3 years ago

corneliusmunz commented 3 years ago

@m9lab figured out in the gitter chat (https://gitter.im/legoinochat/community?at=5f96b2fcc7ef520fffc61333) that the library detects the color CYAN (value = 5) for a GREEN brick. After a short evaluation i can confirm this issue.

But some strange things appear here while checking the issue:

If you setup a PoweredUp program on the iOS or Android app, the sensor detects GREEN with the color detection block. But if you feed in the block to the Hub LED, the Hub LED will be set to CYAN. So i think the color sensor firmware does a wrong mapping of the GREEN color to the value 5 which means in Lego colors CYAN. In the visualisation of the App it seems that a remapping occurs here on the App SW side but if you feed in the value directly to the RGB light of the HUB the remapping is not applied and you see CYAN if your sensor faces a GREEN block.

Maybe some users can try out a similar program as the following and can check if this behaviour could be reproduced. If so, i could do the remapping in the legoino library that the sensor value 5 is mapped to 6.

IMG_7061

corneliusmunz commented 3 years ago

fixed with https://github.com/corneliusmunz/legoino/commit/bb4d8e563a1e467194037e0a5db9b0bda37752ad