From b562328bd0c7f7f2db2343dfe0b5c1b6995639c4 Mon Sep 17 00:00:00 2001 From: Arksine Date: Sat, 11 Jan 2020 20:17:14 -0500 Subject: config: add BME280 documentation Signed-off-by: Eric Callahan --- config/sample-macros.cfg | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'config/sample-macros.cfg') 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 ". +# 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))} -- cgit v1.2.3-70-g09d2