I have been working out for controlling all led lights in my tool changer 3d printer.
I use 50 pieces of dotstar leds and first 18 are bottom of bed, next 29 are in frame and last 3 in toolchanging head. Bed leds are for notification light use to see the status of the printer.
Heres some code for Led control loop. If there is m1 or something in print that requires waiting the operator, variable named global.LEDMode is set to Wait and leds are set to white and bed blue flashing loop will start. If global.LEDMode is set to Printing, leds are set to green and white static.
; LED control loop while 1=1 ; Wait (White, Bed flashing blue) For M1 and filament change etc while global.LEDMode = Wait ;1 <---this while could be if, i guess? M150 B255 S18 P255 F1 ; LED Bed = Blue M150 R255 U255 B255 S29 P255 F1 ; LED Frame = White M150 R255 U255 B255 S3 P255 ; LED ToolHead = White while global.LEDMode = Wait ; Entering flashing loop G4 P1000 ; 1000ms time delay M150 B255 S18 P0 ; Blue off G4 P1000 ; 1000ms time delay M150 B255 S18 P255 ; Blue on if global.LEDMode != Wait break ; Exit flashing loop break ;1 <---then this would be removed ; Printing (White, Bed static green) while global.LEDMode = Printing ;<--- here while is necessary? M150 U255 S18 P255 F1 ; LED Bed = Green M150 R255 U255 B255 S29 P255 F1 ; LED Frame = White M150 R255 U255 B255 S3 P255 ; LED ToolHead = White if global.LEDMode != Printing break ; Exit loop
will this work like i expect?
Meta command doesnt work yet because i have 3.2.2 firmware.
Will that flashing loop work? does it(g4) stop printer if i want same loop for toolchange script?
Thank you in advance!