aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorLucio Tarantino <lucio.tarantino@gmail.com>2020-06-13 02:32:12 +0200
committerGitHub <noreply@github.com>2020-06-12 20:32:12 -0400
commit35bbd989e4383193b8ef4cfef0b262831e611f75 (patch)
tree2c66e0821e9f51f2a127beb05d042ac6280e4000 /config
parent519c3ad5ee0cc84b41d091f721fc6fb006c83209 (diff)
downloadkutter-35bbd989e4383193b8ef4cfef0b262831e611f75.tar.gz
kutter-35bbd989e4383193b8ef4cfef0b262831e611f75.tar.xz
kutter-35bbd989e4383193b8ef4cfef0b262831e611f75.zip
docs: LinuxMCU doc & script (#2956)
Signed-off-by: Lucio Tarantino <lucio.tarantino@gmail.com>
Diffstat (limited to 'config')
-rw-r--r--config/sample-raspberry-pi.cfg45
1 files changed, 45 insertions, 0 deletions
diff --git a/config/sample-raspberry-pi.cfg b/config/sample-raspberry-pi.cfg
new file mode 100644
index 00000000..06d612c7
--- /dev/null
+++ b/config/sample-raspberry-pi.cfg
@@ -0,0 +1,45 @@
+# This file contains an example configuration with RPi as secondary mcu
+
+# See both the example.cfg and example-extras.cfg file for a
+# description of available parameters.
+
+# The rpi microcontroller is used as secondary.
+# Typically, both the X and Y axes
+# are connected to the main micro-controller. The rpi microcontroller is used
+# on non time-critical functions such as enclosure sensors, additional fan or
+# light sources
+[mcu host]
+serial: /tmp/klipper_host_mcu
+
+# Example1: A led strip controlled by the GPIO20 on the RPi
+[output_pin caselight]
+pin: host:gpio20
+# You can also write the pin in extended form by specifying
+# the reference gpiochip.
+#pin: host:gpiochip0/gpio20
+
+[gcode_macro TOGGLE_CASELIGHT]
+gcode:
+ SET_PIN PIN=caselight VALUE={(not printer['output_pin caselight'].value)|int}
+
+
+# Example2: Using the i2c bus of the RPi to read a sensor
+[temperature_sensor enclosure_temp]
+sensor_type: HTU21D
+i2c_mcu: host
+i2c_bus: i2c.1
+htu21d_hold_master: False
+
+[gcode_macro QUERY_ENCLOSURE]
+default_parameter_SENSOR: htu21d enclosure_temp
+gcode:
+ {printer.gcode.action_respond_info(
+ "Temperature: %.2f C\n"
+ "Humidity: %.2f%%" % (
+ printer[SENSOR].temperature,
+ printer[SENSOR].humidity))}
+
+# Example 3:Using a pin on another gpiochip connected to the RPi
+# (in this case on an MCP23017)
+[fan]
+pin: host:gpiochip2/gpio7