Gcode M42 P15

Hi there, I'm trying to use GCODE for some laser engraving projects. I'm using MKII stock but I don't know how to modulate the laser or to trigger 1% pwm for that laser. I tried "M42 P15 S2" or "M42 P15 S255" but it's not working. The only commands that are working are:

    • M42 P15 S0 - for turning it off
    • M42 P15 S1 - for turning it on full power

I'm pretty sure this can be done somehow as when the printer start, the laser is ON on a lower power and then is switched OFF. Can somebody let me know how this should be done? Thanks.