ze08g_ch2o - ZE08G-CH2O electrochemical formaldehyde module#

Adaptation status unknown

Note

This page document is automatically generated by this file. If there is any error, please submit issue or help modify pr, thank you!

Example

--Note: due to the use of sys.wait() all apis need to be used in the coroutine
-- Usage Examples
sys = require("sys")
local ch2o = require "ze08g_ch2o"
local uartid = 1 -- According to the actual equipment to select different uartid

sys.taskInit(function ()
    local result = ch2o.init(uartid)
    if not result then return end

    while true do
        sys.wait(1000)
        log.info("Gas concentration value PPB:", ch2o.getPPB())
        log.info("ppm concentration PPM:", ch2o.getPPM())
    end
end)

ze08g_ch2o.init(uart_id)#

ze08g_ch2o Initialization

Parameters

Incoming Value Type

Explanation

number

uart_id uartid

Return Value

return value type

explanation

bool

Successful return true

Examples

ze08g_ch2o.init(1)

ze08g_ch2o.getPPB()#

Get ze08g_ch2o PPB data

Parameters

None

Return Value

return value type

explanation

number

Gas concentration value

Examples

local ppb = ze08g_ch2o.getPPB()
log.info("Gas concentration value PPB:", ppb))

ze08g_ch2o.getPPM()#

Get ze08g_ch2o PPM data

Parameters

None

Return Value

return value type

explanation

number

ppm concentration

Examples

local ppm = ze08g_ch2o.getPPM()
log.info("ppm concentration PPM:", ppm))