Page 1 of 1

Switching lights on via G-Code

Posted: Sat Apr 07, 2018 6:50 am
by senti1000
I was wondering how to switch on the build-in LED strip for the me creator 2 via G-Code.
Hoped, that M355 S1 P128 would do the trick but it doesn't.
Via LCD panel, it just works fine.

Re: Switching lights on via G-Code

Posted: Wed Apr 11, 2018 2:49 am
by _kaktus_
From the gcode manual:

M150 - Set RGB(W) Color
lcd Set the color of the RGB(W) LED, backlight, or LED strip. BLINKM|RGB_LED|RGBW_LED|NEOPIXEL_LED|PCA9632

If you have an RGB(W) light, either as part of a controller or installed separately, the M150 command can be used to set its color.
Usage
M150 [B<intensity>] [P<intensity>] [R<intensity>] [U<intensity>] [W<intensity>]

Argument Description
[B<intensity>] - Blue component from 0 to 255
[P<intensity>] - Brightness from 0 to 255 (NEOPIXEL_LED only)
[R<intensity>] - Red component from 0 to 255
[U<intensity>] - Green component from 0 to 255
[W<intensity>] - White component from 0 to 255 (RGBW_LED or NEOPIXEL_LED only)



M355 - Case Light Control
control Turn the case light on or off, set brightness CASE_LIGHT_PIN

Set the case light power state and/or brightness.
Usage
M355 [P<byte>] [S<bool>]

Argument Description
[P<byte>] - Set the brightness factor from 0 to 255.
[S<bool>] - Turn the case light on or off.

Notes
Requires a CASE_LIGHT_PIN to control the on/off or PWM state of the case light. The pin will need to be a 12V MOSFET pin with PWM control, or a signal pin connected to a MOSFET or relay to control the higher current required for the light.
Example

Turn the case light on at half brightness

M355 S1 P128

Re: Switching lights on via G-Code

Posted: Fri Apr 13, 2018 1:52 am
by senti1000
Sending the
M355 S1 P128
code does not lead to any change.
I haven't found how to control the lights via G-code.
Any idea, anyone?

Re: Switching lights on via G-Code

Posted: Fri Apr 13, 2018 5:01 am
by senti1000
Ok, figured it out by myself:
The lights are connected to PIN 6.
This makes it possible to switch on the lights by
M42 P6 S255

Switching off:
M42 P6 S0

And of course you could dimm the lights as well, e.g.
M42 P6 S128