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

doubled RGB->GRB fix #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

thijses
Copy link

@thijses thijses commented Jan 23, 2024

First of all, nice library, thank you for taking the time to do the low level register stuff, it's saved me some frustration :).

I noticed that in the write_string function, you pass the contents of the RGB struct in GRB order to the write(R,G,B) function:

write(led_data[i].g,led_data[i].r,led_data[i].b);

isn't this a double re-ordering (because the write() function expects (r,g,b) input, and writes the data as (g,r,b) to the LED):
void CI_WS2812B::write(uint8_t red, uint8_t green, uint8_t blue)
{
SPI_transfer(green);
SPI_transfer(red);
SPI_transfer(blue);
}

fixed doubled RGB->GRB switching
@ClemensAtElektor
Copy link
Owner

Thank you for your comments. The code just swaps red and green, it is not reordering twice. I don't remember why, sorry. The colors probably got mixed up somewhere.

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