Instructions
www.joy-it.net
Pascalstr. 8 47506 Neukirchen-Vluyn
int flame=0; // analog pin 0 for sensor
int Beep=9; // digital pin 9 for buzzer
int val=0; // defines variable val
void setup() {
pinMode(Beep,OUTPUT); // sets buzzer pin as output
pinMode(flame,INPUT); // sets sensor pin as input
Serial.begin(9600); // sets baudrate to 9600
}
void loop() {
val=analogRead(flame); // reads the analog values of sensor
Serial.println(val); // prints analog values
if(val>=10) { // buzzer makes noises if value if over 10
// if necessary must be adjusted to the values of the sensor
digitalWrite(Beep,HIGH);
}
else{
digitalWrite(Beep,LOW);
}
delay(500);
}