Skip to content

Commit

Permalink
WS2812 example: Improve supported bandwidths (#486)
Browse files Browse the repository at this point in the history
Adjusts constants to 3,3,4 to support higher bandwidths on any of WS2812, WS2812B, and SK6812 LEDs.
  • Loading branch information
nmcclatchey authored May 2, 2024
1 parent ebf7966 commit 51982de
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions pio/ws2812/ws2812.pio
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@
.program ws2812
.side_set 1

.define public T1 2
.define public T2 5
.define public T3 3
; The following constants are selected for broad compatibility with WS2812,
; WS2812B, and SK6812 LEDs. Other constants may support higher bandwidths for
; specific LEDs, such as (7,10,8) for WS2812B LEDs.

.define public T1 3
.define public T2 3
.define public T3 4

.lang_opt python sideset_init = pico.PIO.OUT_HIGH
.lang_opt python out_init = pico.PIO.OUT_HIGH
Expand Down Expand Up @@ -49,9 +53,9 @@ static inline void ws2812_program_init(PIO pio, uint sm, uint offset, uint pin,

.program ws2812_parallel

.define public T1 2
.define public T2 5
.define public T3 3
.define public T1 3
.define public T2 3
.define public T3 4

.wrap_target
out x, 32
Expand Down

0 comments on commit 51982de

Please sign in to comment.