diff options
author | Daniel Friesel <derf@finalrewind.org> | 2022-05-26 07:52:52 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2022-05-26 07:53:05 +0200 |
commit | 102dd0072d34fa081f5861148be61c0c3739827c (patch) | |
tree | 301fe5c2bb61d06da0db3e45cf573509a85e5fd3 /README.md | |
parent | ee6a1033c293f3d3b327568fe9554d4651c4c964 (diff) |
verify checksum, parse automatic baseline correction data
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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 |