Skip to content

RGBW NeoPixel setter: W only works with 4-element tuples, is ignored in packed integers #5725

@PaintYourDragon

Description

@PaintYourDragon

CircuitPython version

Adafruit CircuitPython 7.0.0 but probably affects all versions.

Code/REPL

import board
import neopixel

pixels = neopixel.NeoPixel(board.D5, 8, brightness=1.0, auto_write=False, pixel_order=neopixel.GRBW)

pixels[0] = 0x40FF0000       # Should be white+red
pixels[1] = 0x4000FF00       # Should be white+green
pixels[2] = 0x400000FF       # Should be white+blue
pixels[3] = 0x40000000       # Should be white
pixels[4] = (255, 0, 0, 64) # Is white + red
pixels[5] = (0, 255, 0, 64) # Is green + red
pixels[6] = (0, 0, 255, 64) # Is blue + red
pixels[7] = (0, 0, 0, 64)   # Is white
pixels.show()

Behavior

No error, but incorrect colors from integer values; white is not set (tuples are correct).

What’s more, and particularly strange, is when attempting the white+blue integer setting above, if white is anything other than 0 or 255, the LED is lit green rather than blue (it might be a different primary if a strip uses different pixel_order, but this is what I’m seeing here with a particular RGBW strip), which kind of suggests some bits aren’t being properly masked or something.

Description

Please see this issue:
adafruit/Adafruit_CircuitPython_FancyLED#25

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions