upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
Public Member Functions

API for the PPD42NS Dust Sensor. More...

Detailed Description

UPM module for the PPD42NS dust sensor

ppd42ns.jpg
// Instantiate a dust sensor on GPIO pin D8
upm::PPD42NS dust(8);
cout << "This program will give readings every 30 seconds until "
<< "you stop it" << endl;
while (shouldRun) {
data = dust.getData();
cout << "Low pulse occupancy: " << data.lowPulseOccupancy << endl;
cout << "Ratio: " << data.ratio << endl;
cout << "Concentration: " << data.concentration << endl;
cout << endl;
}

Public Member Functions

 PPD42NS (int pin)
 
 ~PPD42NS ()
 
ppd42ns_dust_data getData ()
 

Constructor & Destructor Documentation

PPD42NS ( int  pin)

PPD42NS constructor

Parameters
pinDigital pin to use
~PPD42NS ( )

PPD42NS destructor

Here is the call graph for this function:

Member Function Documentation

ppd42ns_dust_data getData ( )

Prints dust concentration

Returns
struct ppd42ns_dust_data Contains data from the dust sensor

Here is the call graph for this function:


The documentation for this class was generated from the following files: