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

User report of incorrect color mapping in PmodOLED RGB drivers #41

Open
artvvb opened this issue Jul 25, 2019 · 2 comments
Open

User report of incorrect color mapping in PmodOLED RGB drivers #41

artvvb opened this issue Jul 25, 2019 · 2 comments

Comments

@artvvb
Copy link
Member

artvvb commented Jul 25, 2019

https://forum.digilentinc.com/topic/18605-pmod-oledrgb-really-oledgrb/

@nikAizuddin
Copy link

Hi, is there any update for this issue? I'm still having the same issue as mentioned in the topic (RGB becomes BRG mapping).

Tested with:

  • Arty-Z7-20
  • Vivado & Vitis 2022.2

@nikAizuddin
Copy link

Modifying PmodOLEDrgb.c does fixed my problem though:

@@ -1172,7 +1172,7 @@ u16 OLEDrgb_BuildHSV(u8 hue, u8 sat, u8 val) {
 **      Converts separate RGB values into a 565 RGB value used by the OLEDrgb
 */
 u16 OLEDrgb_BuildRGB(u8 R, u8 G, u8 B) {
-   return ((R >> 3) << 11) | ((G >> 2) << 5) | (B >> 3);
+   return ((B >> 3) << 11) | ((R >> 2) << 5) | (G >> 3);
 }

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

No branches or pull requests

2 participants