diff options
Diffstat (limited to 'klippy')
-rw-r--r-- | klippy/extras/neopixel.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/klippy/extras/neopixel.py b/klippy/extras/neopixel.py index 6988b645..2a03da00 100644 --- a/klippy/extras/neopixel.py +++ b/klippy/extras/neopixel.py @@ -25,7 +25,7 @@ class PrinterNeoPixel: def build_config(self): cmd_queue = self.mcu.alloc_command_queue() self.neopixel_send_cmd = self.mcu.lookup_command( - "neopixel_send oid=%c data=%*s", cq=cmd_queue) + "neopixel_send oid=%c data=%u", cq=cmd_queue) cmd_SET_NEOPIXEL_help = "Set the color of a neopixel led" def cmd_SET_NEOPIXEL(self, params): # Parse parameters @@ -35,11 +35,11 @@ class PrinterNeoPixel: red = int(red * 255. + .5) blue = int(blue * 255. + .5) green = int(green * 255. + .5) + val = (green << 16) | (red << 8) | blue # Send command print_time = self.printer.lookup_object('toolhead').get_last_move_time() minclock = self.mcu.print_time_to_clock(print_time) - self.neopixel_send_cmd.send([self.oid, [green, red, blue]], - minclock=minclock) + self.neopixel_send_cmd.send([self.oid, val], minclock=minclock) def load_config_prefix(config): return PrinterNeoPixel(config) |