config: add BME280 documentation

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Arksine
2020-01-11 20:17:14 -05:00
committed by KevinOConnor
parent 2159f398ea
commit b562328bd0
2 changed files with 53 additions and 0 deletions

View File

@@ -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))}