Hydrogen Sulfide Sensor
The HydrogenSulfide sensor class provides access to a hydrogen sulfide sensor.
Constructor
Section titled “Constructor”HydrogenSulfide(options)
Section titled “HydrogenSulfide(options)”Creates a new HydrogenSulfide object instance.
HydrogenSulfide(options)Parameters
Section titled “Parameters”options
An object of properties used to construct the class.
sensor- The hardware connection definition.
interval(optional) - The sampling interval in milliseconds.
Instance Methods
Section titled “Instance Methods”sample()
Section titled “sample()”Returns a sample object containing the current H2S concentration data.
sample()Return Value
Section titled “Return Value”An object with the following property:
H2S- A number that represents the sampled hydrogen sulfide in parts per million (ppm).
Examples
Section titled “Examples”const sensor = new device.sensor.HydrogenSulfide({ sensor: { io: device.io.I2C, address: 0x37 }});
const sample = sensor.sample();console.log(`H2S Level: ${sample.H2S} ppm`);