-
Notifications
You must be signed in to change notification settings - Fork 908
ws2812 fixes #610
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
base: master
Are you sure you want to change the base?
ws2812 fixes #610
Conversation
`pixel_grb << 8u` in `put_pixel` would shift out the `w` and set white to green, green to to red, red to blue and blue to 0.
@@ -123,7 +144,11 @@ int main() { | |||
bool success = pio_claim_free_sm_and_add_program_for_gpio_range(&ws2812_program, &pio, &sm, &offset, WS2812_PIN, 1, true); | |||
hard_assert(success); | |||
|
|||
#if IS_800KHz | |||
ws2812_program_init(pio, sm, offset, WS2812_PIN, 800000, IS_RGBW); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps it makes more sense to add e.g. #define WS2812_FREQUENCY 800000
and then pass that to ws2812_program_init
, rather than adding a #if IS_800KHz
section?
@@ -17,15 +17,19 @@ | |||
* Take into consideration if your WS2812 is a RGB or RGBW variant. | |||
* | |||
* If it is RGBW, you need to set IS_RGBW to true and provide 4 bytes per | |||
* pixel (Red, Green, Blue, White) and use urgbw_u32(). | |||
* pixel (Red, Green, Blue, White) and use urgb_u32() or urgbw_u32(). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't tell why you've effectively removed support for urgbw_u32()
?
No description provided.