neopixel: Add support for delaying updates in SET_LED command

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2019-12-15 23:24:17 -05:00
parent ab5540bd34
commit 254789f4c5
3 changed files with 16 additions and 7 deletions

View File

@@ -60,8 +60,11 @@ class PrinterNeoPixel:
blue = self.gcode.get_float('BLUE', params, 0., minval=0., maxval=1.)
index = self.gcode.get_int('INDEX', params, None,
minval=1, maxval=self.chain_count)
transmit = self.gcode.get_int('TRANSMIT', params, 1)
self.update_color_data(red, green, blue, index)
# Send command
if not transmit:
return
print_time = self.printer.lookup_object('toolhead').get_last_move_time()
self.send_data(self.mcu.print_time_to_clock(print_time))