M150 with NeoPixels
-
This statement, coupled with some wrong information out on the internet which uses the word "scroll" incorrectly, creates a confusing situation. It took me about a day to sort it out:
"The specified RGB values will be sent to the number of LEDs in the LED strip as specified by the S parameter, pushing the existing colours along the strip. To set all the LEDs the same colour, make the S parameter equal to or a little longer than the number of LEDs in the strip."
Strictly speaking, it is not correct that anything "pushes existing colors along the strip". That doesn't happen, ever.
What happens is: After an M150 F0 command, the M150 commands append to one another, in order, not changing what's displayed, until another M150 F0 is reached. Then the whole string of appended new LED values (including the ones in the new M150 F0) get displayed, starting at the beginning of the strip. Only as many LEDs as those statements specified get changed, leaving any LEDs further along the strip with their prior values.
There is no "scrolling" or "pushing existing colors along". The new values simply "overwrite" existing ones, from the beginning of the strip, and only as far as they "need" to, and it doesn't happen visibly until the M150 F0.
A chaser, first lighting LEDs in a line, then darkening them in the same direction, would look like this (tested on 10 LED NeoPixel stick):
M150 P0 S10 F0 E0 ; Turn entire strip off while iterations < 10 M150 R255 U0 B0 P32 S{iterations+1} F0 E0 G4 P20 while iterations < 9 M150 R0 U0 B0 P0 S{iterations + 1} F1 E0 M150 R255 U0 B0 P32 S{9 - iterations} F0 E0 G4 P20 M150 R0 U0 B0 P0 S10 F0 E0 ; Turn entire strip off
-
@DonStauffer thanks for reporting this. I am sure @droftarts will pick it up when he can.
-
@DonStauffer Thanks. I've updated the M150 Gcode entry, including a 'Usage' section, to make it clear how the M150 command works. I also updated the Notes to clarify which pins can be used, and their capabilities. https://docs.duet3d.com/en/User_manual/Reference/Gcodes#m150-set-led-colours
Ian
-
@droftarts I'll let you know if this NeoPixel driver works. I think there's a good chance, since it seems like exactly what it's made for. If it does work, I'd recommend a brief mention of it in the docs since it will be a much better solution that just a TTL buffer, and actually cheaper.
-
@DonStauffer I'd like to report a successful proof of concept.
I've set up the NeoDriver and used M260 to communicate with it, and set up daemon.g and some supporting macros. My G29 command now successively lights 10 LEDs, effectively graphing progress of the bed probing.
After I do a small amount of fine-tuning, I'm going to set it up for heating processes, and the overall print job.
-
@DonStauffer Thanks for that!
@droftarts ping for documentation update.
-