| m0042 |
Set Pin State |
Set an analog or digital pin to a specified state. |
thinkyhead |
DIRECT_PIN_CONTROL |
control |
|
|
| tag |
optional |
since |
description |
values |
| I |
true |
1.1.9.1 |
Ignore protection on pins that Marlin is using. |
|
|
| tag |
optional |
since |
description |
values |
| T |
true |
2.0.5.2 |
Set the pin mode. Prior to Marlin 2.0.9.4 this is set with the `M` parameter. |
| tag |
description |
| 0 |
`INPUT` |
|
| tag |
description |
| 1 |
`OUTPUT` |
|
| tag |
description |
| 2 |
`INPUT_PULLUP` |
|
| tag |
description |
| 3 |
`INPUT_PULLDOWN` |
|
|
|
| tag |
optional |
description |
values |
| P |
true |
A digital pin number (even for analog pins) to write to. (`LED_PIN` if omitted) |
|
|
| tag |
optional |
description |
values |
| S |
false |
The state to set. PWM pins may be set from 0-255. |
|
|
|
| pre |
code |
| Turn the LED pin on |
M42 S1 |
|
| pre |
code |
| Turn on pin 33 |
M42 P33 S1 |
|
| pre |
code |
| Set pin 44 to do PWM with 50% DC |
M42 P44 S128 |
|
|