mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-24 07:04:01 -06:00
neopixel: Add support for delaying updates in SET_LED command
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
ab5540bd34
commit
254789f4c5
3 changed files with 16 additions and 7 deletions
|
@ -48,6 +48,7 @@ class PrinterDotstar:
|
|||
red = self.gcode.get_float('RED', params, 0., minval=0., maxval=1.)
|
||||
green = self.gcode.get_float('GREEN', params, 0., minval=0., maxval=1.)
|
||||
blue = self.gcode.get_float('BLUE', params, 0., minval=0., maxval=1.)
|
||||
transmit = self.gcode.get_int('TRANSMIT', params, 1)
|
||||
red = int(red * 255. + .5)
|
||||
blue = int(blue * 255. + .5)
|
||||
green = int(green * 255. + .5)
|
||||
|
@ -59,6 +60,8 @@ class PrinterDotstar:
|
|||
else:
|
||||
self.color_data[4:-4] = color_data * self.chain_count
|
||||
# Send command
|
||||
if not transmit:
|
||||
return
|
||||
print_time = self.printer.lookup_object('toolhead').get_last_move_time()
|
||||
self.send_data(self.spi.get_mcu().print_time_to_clock(print_time))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue