Switching lights on via G-Code

Post Reply
senti1000
Posts: 0
Joined: Tue Mar 27, 2018 4:38 pm

Switching lights on via G-Code

Post by senti1000 » Sat Apr 07, 2018 6:50 am

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.

User avatar
_kaktus_
Site Admin
Posts: 1260
Joined: Fri Dec 15, 2017 10:06 pm
Location: PL
Contact:

Re: Switching lights on via G-Code

Post by _kaktus_ » Wed Apr 11, 2018 2:49 am

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

senti1000
Posts: 0
Joined: Tue Mar 27, 2018 4:38 pm

Re: Switching lights on via G-Code

Post by senti1000 » Fri Apr 13, 2018 1:52 am

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?

senti1000
Posts: 0
Joined: Tue Mar 27, 2018 4:38 pm

Re: Switching lights on via G-Code

Post by senti1000 » Fri Apr 13, 2018 5:01 am

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

Post Reply