Skip to content

Commit 51982de

Browse files
authored
WS2812 example: Improve supported bandwidths (#486)
Adjusts constants to 3,3,4 to support higher bandwidths on any of WS2812, WS2812B, and SK6812 LEDs.
1 parent ebf7966 commit 51982de

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

pio/ws2812/ws2812.pio

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@
77
.program ws2812
88
.side_set 1
99

10-
.define public T1 2
11-
.define public T2 5
12-
.define public T3 3
10+
; The following constants are selected for broad compatibility with WS2812,
11+
; WS2812B, and SK6812 LEDs. Other constants may support higher bandwidths for
12+
; specific LEDs, such as (7,10,8) for WS2812B LEDs.
13+
14+
.define public T1 3
15+
.define public T2 3
16+
.define public T3 4
1317

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

5054
.program ws2812_parallel
5155

52-
.define public T1 2
53-
.define public T2 5
54-
.define public T3 3
56+
.define public T1 3
57+
.define public T2 3
58+
.define public T3 4
5559

5660
.wrap_target
5761
out x, 32

0 commit comments

Comments
 (0)