upm  0.3.1
Sensor/Actuator repository for libmraa (v0.7.2)
Public Member Functions

API for the YG1006 flame sensor. More...

Detailed Description

UPM module for the YG1006 flame sensor. It detects flame or any other light in the 760nm - 1100nm wavelength range.

yg1006.jpg
// 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;
else
cout << "No flame detected." << endl;
sleep(1);
}

Public Member Functions

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

Constructor & Destructor Documentation

YG1006 ( int  pin)

YG1006 digital flame sensor constructor

Parameters
pindigital pin to use
~YG1006 ( )

YG1006 Destructor

Member Function Documentation

bool flameDetected ( )

Determine whether a flame has been detected

Returns
True if a flame or other comparable light source is detected

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