Hydrogen Sensor
The Hydrogen sensor class provides access to a hydrogen sensor.
Constructor
Section titled “Constructor”Hydrogen(options)
Section titled “Hydrogen(options)”Creates a new Hydrogen object instance.
Hydrogen(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 hydrogen concentration data.
sample()Return Value
Section titled “Return Value”An object with the following property:
H- A number that represents the sampled hydrogen in parts per million (ppm).
Examples
Section titled “Examples”const sensor = new device.sensor.Hydrogen({ sensor: { io: device.io.I2C, address: 0x22 }});
const sample = sensor.sample();console.log(`Hydrogen level: ${sample.H} ppm`);