当前位置:网站首页>Arduino flame sensor (with code)

Arduino flame sensor (with code)

2022-06-23 05:10:00 Loading_ create

Flame sensor wiring

Flame module modules and numbers 13 The interface comes with LED Build a simple circuit , Make a flame light . Use numbers 13 The interface comes with LED, Connect the flame sensor to the digital 3 Interface , When the flame sensor senses a key signal ,LED bright , On the contrary, it will extinguish ..
Here's the picture :
 Insert picture description here
Routine source code :

int Led=13;// Definition LED  Interface 
int buttonpin=3; // Define the flame sensor interface int val;// Define digital variables val
void setup()
{
    
	pinMode(Led,OUTPUT);// Definition LED  Is the output interface 
	pinMode(buttonpin,INPUT);// Define the flame sensor as the output interface 
}
void loop()
{
    
	val=digitalRead(buttonpin);// Connect the digital interface 3 Read the value assigned to val 
	if(val==HIGH){
    // When the flame sensor detects a signal ,LED  flashing 
		digitalWrite(Led,HIGH);
	}
	else{
    
		digitalWrite(Led,LOW);
	}
}

If help , Please praise the collection , In case of problems , Please send a private message directly .

原网站

版权声明
本文为[Loading_ create]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/174/202206230129230786.html