Skip to content

Commit

Permalink
Fix NeoPixel/WS2812B timing. (#47)
Browse files Browse the repository at this point in the history
- Change frequency from 500kHz to 800kHz to match datasheet.
- Updating high & low timings to match make:code.

Tested on a variety of WS2812B strips as well as SK6812 RGB and RGBW strips.

Signed-off-by: Jim Mussared <[email protected]>
  • Loading branch information
jimmo authored Jun 12, 2023
1 parent 76dbf90 commit 84b1aee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions inc/WS2812B.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ DEALINGS IN THE SOFTWARE.

#define WS2812B_BUFFER_SIZE 256
#define WS2812B_PAD (0x8000)
#define WS2812B_LOW (0x8000 | 6)
#define WS2812B_HIGH (0x8000 | 10)
#define WS2812B_PWM_FREQ 500000
#define WS2812B_LOW (0x8000 | 5) // 320ns
#define WS2812B_HIGH (0x8000 | 12) // 760ns
#define WS2812B_PWM_FREQ 800000
#define WS2812B_ZERO_PADDING 50

/**
Expand Down Expand Up @@ -128,4 +128,4 @@ namespace codal
void _play(const void *data, int length, bool mode);
};
}
#endif
#endif

0 comments on commit 84b1aee

Please sign in to comment.