From 02d770ae3cd441581eeac9dc7a399e2cf507d147 Mon Sep 17 00:00:00 2001 From: electron2410 <66944639+electron2410@users.noreply.github.com> Date: Mon, 14 Mar 2022 17:30:58 +0100 Subject: [PATCH] neopixel: add BGR for neopixel (#5160) Signed-off-by: Thomas Liebold --- docs/Config_Reference.md | 2 +- klippy/extras/neopixel.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/Config_Reference.md b/docs/Config_Reference.md index 83503867..66205fc3 100644 --- a/docs/Config_Reference.md +++ b/docs/Config_Reference.md @@ -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 diff --git a/klippy/extras/neopixel.py b/klippy/extras/neopixel.py index 2c79b327..4d3be21c 100644 --- a/klippy/extras/neopixel.py +++ b/klippy/extras/neopixel.py @@ -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: