diff options
author | Arksine <arksine.code@gmail.com> | 2020-01-11 20:17:14 -0500 |
---|---|---|
committer | KevinOConnor <kevin@koconnor.net> | 2020-01-13 22:29:50 -0500 |
commit | b562328bd0c7f7f2db2343dfe0b5c1b6995639c4 (patch) | |
tree | a1b0b0e69c91e7bc04e1100258b898469bc1ffa8 /config/sample-macros.cfg | |
parent | 2159f398ea6affd2581650992b0ccd928f7572be (diff) | |
download | kutter-b562328bd0c7f7f2db2343dfe0b5c1b6995639c4.tar.gz kutter-b562328bd0c7f7f2db2343dfe0b5c1b6995639c4.tar.xz kutter-b562328bd0c7f7f2db2343dfe0b5c1b6995639c4.zip |
config: add BME280 documentation
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Diffstat (limited to 'config/sample-macros.cfg')
-rw-r--r-- | config/sample-macros.cfg | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/config/sample-macros.cfg b/config/sample-macros.cfg index 5f965fb1..3b92e34b 100644 --- a/config/sample-macros.cfg +++ b/config/sample-macros.cfg @@ -115,3 +115,35 @@ gcode: G91 G1 E-50 F1000 RESTORE_GCODE_STATE NAME=M600_state + +###################################################################### +# BME280 Environmental Sensor +###################################################################### + +# The macro below assumes you have a BME280 sensor_type defined in one +# of the applicable sections in printer.cfg, such as: +# +#[temperature_sensor my_sensor] +#sensor_type: BME280 +#gcode_id: AMB +# +# Note the format of the parameter SENSOR in the macro below. The BME280 +# sensor status can be accessed using the format "bme280 <section_name>". +# The example section above is named "my_sensor", thus the bme280 can be +# queried as follows: +# +# QUERY_BME280 SENSOR='bme280 my_sensor' +# +# Since a default parameter is defined one could simply enter QUERY_BME280 +# as well. + +[gcode_macro QUERY_BME280] +default_parameter_SENSOR: bme280 my_sensor +gcode: + {printer.gcode.action_respond_info( + "Temperature: %.2f C\n" + "Pressure: %.2f hPa\n" + "Humidity: %.2f%%" % ( + printer[SENSOR].temperature, + printer[SENSOR].pressure, + printer[SENSOR].humidity))} |