#define FLAME_SENSOR 4

#define RED_PIN 26
#define GREEN_PIN 25

void setup() {
  Serial.begin(115200);

  pinMode(FLAME_SENSOR, INPUT);

  pinMode(RED_PIN, OUTPUT);
  pinMode(GREEN_PIN, OUTPUT);
}

void loop() {

  int flameState = digitalRead(FLAME_SENSOR);

  if (flameState == LOW) {   // Fire detected
    Serial.println("🔥 Fire Detected!");

    digitalWrite(RED_PIN, HIGH);
    digitalWrite(GREEN_PIN, LOW);
  }
  else {
    Serial.println("No Fire - Safe");

    digitalWrite(RED_PIN, LOW);
    digitalWrite(GREEN_PIN, HIGH);
  }

  delay(500);
}