From 102dd0072d34fa081f5861148be61c0c3739827c Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 26 May 2022 07:52:52 +0200 Subject: verify checksum, parse automatic baseline correction data --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 84bd62c..f6fed93 100644 --- a/README.md +++ b/README.md @@ -41,17 +41,17 @@ levels at boot time and may therefore be unsuitable for MH-Z19 connection. Copy **mh-z19.lua** to your NodeMCU board and set it up as follows. ```lua -mhz19 = require("mh-z19") +mh_z19 = require("mh-z19") port = softuart.setup(9600, 1, 2) port:on("data", 9, uart_callback) function uart_callback(data) - if sds011.parse_frame(data) then - -- mhz19.co2 contains the CO₂ concentration in ppm + if mh_z19.parse_frame(data) then + -- mh_z19.co2 contains the CO₂ concentration in ppm end end -port:write(mhz19.query()) +port:write(mhz19.c_query) ``` ## Application Example -- cgit v1.2.3