mirror of https://github.com/Desuuuu/klipper.git
neopixel: add BGR for neopixel (#5160)
Signed-off-by: Thomas Liebold <electron2410@gmail.com>
This commit is contained in:
parent
7731c30422
commit
02d770ae3c
|
@ -2556,7 +2556,7 @@ pin:
|
|||
# Neopixel is connected to the pin).
|
||||
#color_order: GRB
|
||||
# Set the pixel order required by the LED hardware. Options are GRB,
|
||||
# RGB, BRG, GRBW, or RGBW. The default is GRB.
|
||||
# RGB, BRG, BGR, GRBW, or RGBW. The default is GRB.
|
||||
#initial_RED: 0.0
|
||||
#initial_GREEN: 0.0
|
||||
#initial_BLUE: 0.0
|
||||
|
|
|
@ -24,7 +24,7 @@ class PrinterNeoPixel:
|
|||
self.oid = self.mcu.create_oid()
|
||||
self.pin = pin_params['pin']
|
||||
self.mcu.register_config_callback(self.build_config)
|
||||
formats = {v: v for v in ["RGB", "GRB", "BRG", "RGBW", "GRBW"]}
|
||||
formats = {v: v for v in ["RGB", "GRB", "BRG", "BGR", "RGBW", "GRBW"]}
|
||||
self.color_order = config.getchoice("color_order", formats, "GRB")
|
||||
elem_size = len(self.color_order)
|
||||
self.chain_count = config.getint('chain_count', 1, minval=1,
|
||||
|
@ -69,6 +69,8 @@ class PrinterNeoPixel:
|
|||
color_data = [red, green, blue]
|
||||
elif self.color_order == "BRG":
|
||||
color_data = [blue, red, green]
|
||||
elif self.color_order == "BGR":
|
||||
color_data = [blue, green, red]
|
||||
elif self.color_order == "GRBW":
|
||||
color_data = [green, red, blue, white]
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue