forked from DaVinci-10/v4l2-ctrl-macros-for-Klipper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
v4lctls.cfg
100 lines (81 loc) · 3.07 KB
/
v4lctls.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Runs a linux command or script from within klipper. Note that sudo commands
# that require password authentication are disallowed. All executable scripts
# should include a shebang.
# v4l2-ctl -c pan_absolute=0
# v4l2-ctl -c tilt_absolute=0
# v4l2-ctl -c zoom_absolute=0
# v4l2-ctl -c pan_absolute=201600
# v4l2-ctl -c tilt_absolute=201600
# v4l2-ctl -c zoom_absolute=10
# v4l2-ctl -c pan_absolute=-201600
# v4l2-ctl -c tilt_absolute=201600
# v4l2-ctl -c zoom_absolute=5 #midway
# v4l2-ctl -c zoom_absolute=10
# v4l2-ctl -c focus_automatic_continuous=1 #debian_desktop
# v4l2-ctl -c focus_automatic_continuous=0
# v4l2-ctl -c focus_auto=1 #ubuntu_server
# v4l2-ctl -c focus_auto=0
# v4l2-ctl -c brightness={BRIGHTNESS}
# v4l2-ctl -c contrast={CONTRAST}
# video0 is the default for the macros, see example for non-video0
# note there must be a space following the command: v4l2-ctl for parameters to work correctly.
#[gcode_shell_command v4l2-ctl]
#command = v4l2-ctl -d /dev/v4l/by-id/usb-Microsoft_Microsoft®_LifeCam_HD-6000_for_Notebooks-video-index0
#timeout = 5.0
#verbose = True
[gcode_shell_command v4l2-ctl]
command: v4l2-ctl
timeout: 5.0
verbose: True
[gcode_macro cam_settings]
gcode:
RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-l"
[gcode_macro pan_left]
gcode:
RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-c pan_absolute=201600"
[gcode_macro pan_right]
gcode:
RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-c pan_absolute=-201600"
[gcode_macro pan_center]
gcode:
RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-c pan_absolute=0"
[gcode_macro tilt_up]
gcode:
RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-c tilt_absolute=-201600"
[gcode_macro tilt_down]
gcode:
RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-c tilt_absolute=201600"
[gcode_macro tilt_center]
gcode:
RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-c tilt_absolute=0"
[gcode_macro zoom_in]
gcode:
RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-c zoom_absolute=10"
[gcode_macro zoom_mid]
gcode:
RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-c zoom_absolute=5"
[gcode_macro zoom_out]
gcode:
RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-c zoom_absolute=0"
[gcode_macro focus_manual]
gcode:
RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-c focus_auto=0"
[gcode_macro focus_auto]
gcode:
RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-c focus_auto=1"
[gcode_macro focus_absolute]
gcode:
{% set focus_absolute = params.FOCUS|default(14) %}
RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-c focus_absolute="{focus_absolute}
[gcode_macro brightness]
gcode:
{% set brightness_level = params.BRIGHTNESS|default(133) %}
RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-c brightness="{brightness_level}
[gcode_macro contrast]
gcode:
{% set contrast_level = params.CONTRAST|default(5) %}
RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-c contrast="{contrast_level}
[gcode_macro sharpness]
gcode:
{% set sharpness = params.SHARPNESS|default(20) %}
RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-c sharpness="{sharpness}