コード例 #1
0
  // Reads the flame sensor every 1 second
  void senseFlame() {
    for(;;) {
      bool val = flame->flameDetected();
      if (val) {
        cout << "Flame detected." << endl;
        alarm();
      }

      else
      {
        cout << "No flame detected." << endl;
        sleep(1);
      }
    }
  }
コード例 #2
0
 // Reads the flame sensor
 bool flameDetected() {
   return flame->flameDetected();
 }