Skip to content

Commit 7552872

Browse files
committed
Added examples
1 parent a4183de commit 7552872

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

extended_macro/example/example.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def repeat_back(rept):
2+
return rept + ' ' + rept
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
functions:
2+
repeater: # The name which will be used in the GCode to call the function. Must be unique.
3+
path: /home/pi/klipper_functions/example.py # Location of Python script. Must be an absolute path
4+
function: repeat_back # The actual name of the Python function
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Extended_template is used to define the path to your Function Config
2+
[extended_template]
3+
path: /home/pi/klipper_functions/function_config.yaml
4+
5+
[extended_macro REPEAT_MSG]
6+
gcode:
7+
{% set rpt = params.MSG %}
8+
M118 {repeater(rpt)}

0 commit comments

Comments
 (0)