machines/systems/flexibot/docs/marlin/_gcode/M240.md
2025-03-11 23:32:39 +01:00

2.8 KiB

tag title brief author requires group codes notes parameters videos examples
m0240 Trigger Camera Trigger a camera shutter thinkyhead PHOTO_GCODE extras
M240
`CHDK_PIN` or `PHOTOGRAPH_PIN` is required prior to Marlin 2.0.0.
To use the `CHDK_PIN` or `PHOTOGRAPH_PIN` option with a digital camera see [this article](//www.doc-diy.net/photo/rc-1_hacked/).
To use an endstop or contact switch as a shutter switch for your smartphone's camera, see [this video](//youtu.be/i5g3ziK5wpI).
tag optional description values
A true Offset to the X return position. (Requires `PHOTO_POSITION`)
tag type
offset float
tag optional description values
B true Offset to the Y return position. (Requires `PHOTO_POSITION`)
tag type
offset float
tag optional description values
D true Duration to hold down the shutter switch. (Requires `PHOTO_SWITCH_POSITION` and `PHOTO_SWITCH_MS`)
tag type
ms int
tag optional description values
F true Feedrate for the main photo moves. If omitted, the homing feedrate will be used. (Requires `PHOTO_POSITION`)
tag type
feedrate float
tag optional description values
I true Shutter switch X position. If omitted, the photo move X position applies. (Requires `PHOTO_SWITCH_POSITION`)
tag type
pos float
tag optional description values
J true Shutter switch Y position. If omitted, the photo move Y position applies. (Requires `PHOTO_SWITCH_POSITION`)
tag type
pos float
tag optional description values
P true Delay after pressing the shutter switch. (Requires `PHOTO_SWITCH_POSITION` and `PHOTO_SWITCH_MS`)
tag type
ms int
tag optional description values
R true Retract/recover length. (Requires `PHOTO_POSITION`)
tag type
length float
tag optional description values
S true Retract/recover feedrate. (Requires `PHOTO_POSITION`)
tag type
feedrate float
tag optional description values
X true Main photo move X position. (Requires `PHOTO_POSITION`)
tag type
pos float
tag optional description values
Y true Main photo move Y position. (Requires `PHOTO_POSITION`)
tag type
pos float
tag optional description values
Z true Main photo move Z raise. (Requires `PHOTO_POSITION`)
tag type
length float
i5g3ziK5wpI

Trigger a camera shutter using a digital pin or by bumping a physical switch.