Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const int flameSensorPin = 2;
- void setup() {
- Serial.begin(9600);
- pinMode(flameSensorPin, INPUT);
- }
- void loop() {
- int flameValue = digitalRead(flameSensorPin);
- Serial.print("Flame Value: ");
- Serial.println(flameValue);
- if (flameValue == LOW) { // LOW => flame is detected
- Serial.println("Flame Detected!");
- } else {
- Serial.println("No Flame Detected.");
- }
- delay(2000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement