Dust Sensor
The Dust sensor class provides access to a dust sensor.
Constructor
Section titled “Constructor”Dust(options)
Section titled “Dust(options)”Creates a new Dust object instance.
Dust(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 dust concentration data.
sample()Return Value
Section titled “Return Value”An object with the following property:
dust- A number that represents the sampled dust levels in micrograms per cubic meter.
Examples
Section titled “Examples”const sensor = new device.sensor.Dust({ sensor: { io: device.io.Analog, pin: 32 }});
const sample = sensor.sample();console.log(`Dust level: ${sample.dust} ug/m3`);