tjbot-ce - v3.0.0
    Preparing search index...

    Class LEDNeopixel

    LED controller for NeoPixel (WS281x) LEDs on Raspberry Pi 3/4.

    rpi-ws281x-native requires root privileges. Rather than launching every TJBot recipe that uses the LED as root, this class spawns a small, long-lived helper process (in led-neopixel-ws281x.js) using sudo and communicates with it over a newline-delimited JSON IPC channel on stdin/stdout.

    Sudo authentication is performed once at construction time (either passwordless or via an interactive prompt). Subsequent render() calls are cheap IPC messages with no additional privilege escalation.

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Send a reset command and terminate the helper process.

      Returns Promise<void>

    • Wait for the NeoPixel helper to be fully initialized and ready. Call this before loading long-running tasks if the LED needs to be available early.

      Returns Promise<void>

    • Render the NeoPixel to a specific color.

      Parameters

      • color: number

        Color as a 32-bit integer in RGB format (0xRRGGBB)

      Returns Promise<void>