upm  1.3.0
Sensor/Actuator repository for libmraa (v1.7.0)
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Member Functions
PPD42NS Class Reference

API for the PPD42NS Dust Sensor. More...

Detailed Description

UPM module for the PPD42NS dust sensor

// Instantiate a dust sensor on GPIO pin D8
upm::PPD42NS* dust = new upm::PPD42NS(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

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

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: