From d5cc2a7b7beeda9f797228c98cc57b4aa0d03ab4 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Wed, 17 Jul 2019 16:36:28 -0400 Subject: neopixel: Improve timing of gpio bit-banging Signed-off-by: Kevin O'Connor --- klippy/extras/neopixel.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'klippy/extras/neopixel.py') diff --git a/klippy/extras/neopixel.py b/klippy/extras/neopixel.py index 2a03da00..6988b645 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=%u", cq=cmd_queue) + "neopixel_send oid=%c data=%*s", 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, val], minclock=minclock) + self.neopixel_send_cmd.send([self.oid, [green, red, blue]], + minclock=minclock) def load_config_prefix(config): return PrinterNeoPixel(config) -- cgit v1.2.3-70-g09d2