Created
May 13, 2018 07:54
-
-
Save arduinothai/e20c4d4c8156bbcd476f905e62808d20 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int LED = 13; // Use the onboard Uno LED | |
int isFlamePin = 2; // This is our input pin | |
int isFlame = 1; // 1 MEANS NO FLAME | |
void setup() { | |
pinMode(LED, OUTPUT); | |
pinMode(isFlamePin, INPUT); | |
Serial.begin(9600); | |
} | |
void loop() { | |
isFlame = digitalRead(isFlamePin); | |
if (isFlame == 0) | |
{ | |
Serial.println("FLAME, FLAME, FLAME"); | |
digitalWrite(LED, HIGH); | |
} | |
else | |
{ | |
Serial.println("no flame"); | |
digitalWrite(LED, LOW); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment