thinkyhead

M42 - Set Pin State

control Set an analog or digital pin to a specified state.

For custom hardware not officially supported in Marlin, you can often just connect up an unused pin and use M42 to control it.


Usage

M42 [P<int>] S<int>

Argument Description
[P<int>]

A digital pin number (even for analog pins) to write to. (LED_PIN if omitted)

S<int>

The state to set. PWM-able pins may be set from 0-255.