* this project can be found here: https://pi4j.com/
*
*
- ./mvnw clean package
- cd target/distribution
- sudo ./runNeopixel.sh OPT parms........ Parm -t traceLevel
At present this code uses the SPI. The timing is calculated for the Pi4 hardware.
NEOPIXEL WS2812B uses the following timing to represent a '1' or a '0' bit. To accomplish in SPI, a '1' sends a byte0b11111000 and a '0' sends a byte 0b11000000. When the array of bytes are sent via SPI at a specific frequency the WS2812B interprets the bytes as correctly timed 0's and 1's. To accomplish the SPI frequency is set to 8*500_000.
Pulse duration to represent a one or a zero. int32_t highTime0NanoSeconds, 400 ns int32_t lowTime0NanoSeconds, 850 ns int32_t highTime1NanoSeconds, 800 ns int32_t lowTime1NanoSeconds, 450 ns
RED LEDSTRIP 0x00FF00; Transmits 8 short, 8 long, 8 short
GREEN LEDSTRIP 0xFF0000 Transmits 8 long, 8 short, 8 short
BLUE LEDSTRIP 0x0000FF Transmits 8 short, 8 short, 8 long
800/400
300/900
Composition of 24bit data: G7 G6 G5 G4 G3 G2 G1 G0 R7 R6 R5 R4 R3 R2 R1 R0 B7 B6 B5 B4 B3 B2 B1 B0 Note: Follow the order of GRB to sent data and the high bit sent at first.
The NeoPixel94V class assumes the above order Green Red Blue. The code method Render() uses this assumption when inflating the LEDs integer bits to individual bytes.
If your LED strip uses a different order within the 24 bits the render function must be modified.