Advertisement
safwan092

AnalogeReadings-A0 - Arduino Uno - Flame Sensor

Apr 11th, 2018
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.76 KB | None | 0 0
  1.  
  2. // Flame Sensor A0 Pin -> Arduino Pin
  3. int flameSensorPin = A0;
  4.  
  5.  
  6. // Variable/Box to put the new readings from the flame sensor into it
  7. int flameNumber = 0;
  8.  
  9.  
  10. void setup() {
  11.  
  12.   // Setting the Flame Pin as Input (this step is not necessary because the Arduino Analog pins are set as Input by default)
  13.   pinMode(flameSensorPin, INPUT);
  14.  
  15.   // Starting a Serial communication between the computer and the Arduino to recieve the values of the flame detector
  16.   Serial.begin(9600);
  17.  
  18. }
  19.  
  20.  
  21.  
  22. void loop() {
  23.  
  24.   // Reading the value of the detected Infrared wave from the Flame Sensor
  25.   flameNumber = analogRead(flameSensorPin);
  26.  
  27.   // Printing the value of the detected Infrared wave to the computer's Serial Monitor
  28.   Serial.println(flameNumber);
  29.  
  30. delay(1000);
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement