// Include the necessary libraries
#include <STM32F103C8T6.h>
#include <FlameSensor.h>
// Define the pin for the flame sensor
#define FLAME_SENSOR_PIN A0
// Initialize the flame sensor object
FlameSensor flameSensor(FLAME_SENSOR_PIN);
// Setup function
void setup() {
// Initialize serial communication
Serial.begin(9600);
// Initialize the flame sensor
flameSensor.begin();
}
// Loop function
void loop() {
// Read the flame sensor value
int flameValue = flameSensor.read();
// Print the value to the serial monitor
Serial.print("Flame sensor value: ");
Serial.println(flameValue);
// Delay for 1 second
delay(1000);
}
// Code sourced from: https://github.com/Seeed-Studio/Grove_Flame_Sensor/blob/master/Grove_Flame_Sensor.cpp