Skip to main content
/

Site Navigation

Your Account

Choose Language

Help

Revision to M150

Steve Miller

+[title|M150]
+
+
+==== M150: Set LED colours ====
+
+***Parameters***
+
+* ***Rnnn*** Red component, 0-255
+* ***Unnn*** Green component, 0-255
+* ***Bnnn*** Blue component, 0-255
+* ***Pnnn*** Brightness, 0-255 (RepRapFirmware 2.03 and later)
+* ***Snnn*** Number of individual LEDs to set to these colours
+* ***Fn*** Following command action. F0 (default) means this is the last command for the LED strip, so the next M150 command starts at the beginning of the strip. F1 means further M150 commands for the remainder of the strip follow this one.
+* ***Xn*** LED type: X0 = DotStar (default prior to RRF 3.2), X1 = RGB NeoPixel (default in RRF 3.2 and later), X2 = bit-banged RGB NeoPixel, X3 = RGBW NeoPixel (from RRF 3.3), X4 = bit-banged RGBW NeoPixel (from RRF3). This parameter is remembered from one call to the next, so it only needs to be given once. Not all boards support all the modes. On the Duet 3 Mini, X1 selects the NeoPixel output on the main board, and X2 addresses the RGB LEDs on some 12864 displays.
+* ***Ynn*** 'Brightness, 0-31 (alternative to P 0-255)
+* ***Qnnn*** (optional) Use specified SPI frequency (in Hz) instead of the default frequency. This parameter is ont normally needed, and is only processed if X parameter also present. When using NeoPixels, only frequencies in the range 2.4 to 4MHz will work.
+
+***Example***
+
+[code]
+M150 X1 Q3000000 ; set LED type to NeoPixel and set SPI frequency to 3MHz
+M150 R255 P128 S20 F1 ; set first 20 LEDs to red, half brightness, more commands for the strip follow
+M150 U255 B255 P255 S20 ; set next 20 LEDs to cyan, full brightness, finished programming strip
+[/code]
+
+This command is only supported on controllers that have an output connector for DotStar or NeoPixel LEDs.
+
+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.