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
YG1006 Class Reference

API for the YG1006 Flame Sensor. More...

Detailed Description

UPM module for the YG1006 flame sensor. It detects a flame or any other light source in the 760-1,100 nm wavelength range.

// Instantiate a yg1006 flame sensor on digital pin D2
upm::YG1006* flame = new upm::YG1006(2);
// check every second for the presence of a flame
while (shouldRun)
bool val = flame->flameDetected();
if (val)
cout << "Flame detected." << endl;
cout << "No flame detected." << endl;

Public Member Functions

 YG1006 (unsigned int pin)
 ~YG1006 ()
bool flameDetected ()

Constructor & Destructor Documentation

YG1006 ( unsigned int  pin)

YG1006 constructor

pinDigital pin to use
~YG1006 ( )

YG1006 destructor

Here is the call graph for this function:

Member Function Documentation

bool flameDetected ( )

Determines whether a flame has been detected

true if a flame or another comparable light source has been detected

Here is the call graph for this function:

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