当前位置:网站首页>Arduino火焰传感器(含代码)
Arduino火焰传感器(含代码)
2022-06-23 03:53:00 【Loading_create】
火焰传感器接线
火焰模块模块和数字 13 接口自带 LED 搭建简单电路,制作火焰提示灯。利用数字13 接口自带的LED,将火焰传感器接入数字3接口,当火焰传感器感测到有按键信号时,LED 亮,反之则灭.。
如下图:
例程源代码:
int Led=13;//定义LED 接口
int buttonpin=3; //定义火焰传感器接口int val;//定义数字变量val
void setup()
{
pinMode(Led,OUTPUT);//定义LED 为输出接口
pinMode(buttonpin,INPUT);//定义火焰传感器为输出接口
}
void loop()
{
val=digitalRead(buttonpin);//将数字接口3的值读取赋给val
if(val==HIGH){
//当火焰传感器检测有信号时,LED 闪烁
digitalWrite(Led,HIGH);
}
else{
digitalWrite(Led,LOW);
}
}
如有帮助,麻烦点赞收藏,如遇问题,请直接私信。
边栏推荐
- 【毕业季_进击的技术er】送别过去两年迷茫的自己。重整旗鼓,大三我来啦
- 微信小程序:拼图工具箱
- Go learning record II (window)
- STL教程3-异常机制
- An understanding of free() (an error in C Primer Plus)
- Notepad++ find replace group replace retain
- Using editor How to handle MD uploading pictures?
- GNSS速度解算的三种方法
- Flask Foundation: environment setup + configuration + mapping between URL and attempt + redirection + database connection
- 微信小程序:爱情保证书制作生成
猜你喜欢

prometheus、influxdb2.2安装及flume_export下载编译使用

Go learning record II (window)

dolphinscheduler 1.2.1 数据迁移到 dolphinscheduler 2.0.5方法及迁移后数据测试记录

Separate use of alertmanager alarms and use of Prometheus configuration alarm rules

Icer Skill 02makefile script Running VCS Simulation

The paddepaddle model is deployed in a service-oriented manner. After restarting the pipeline, an error is reported, and the TRT error is reported

Can bus Basics

【论文阅读】Semi-Supervised Learning with Ladder Networks

Object structure diagram, which can quickly illustrate the internal structure of an object

The solution to prompt "this list creation could be rewritten as a list literal" when adding elements to the list using the append() method in pychart
随机推荐
Kail infiltration basic literacy basic command
rtklib2.4.3 b34的一个与编译器有关的bug
微信小程序:全新趣味测试
Notepad++ find replace group replace retain
centos7安装postgresql8.2.15及存储过程创建
With the arrival of intelligent voice era, who is defining AI in the new era?
Static two position relay xjls-84/440/dc220v
How to make social media the driving force of cross-border e-commerce? This independent station tool cannot be missed!
How to use data to tell a wonderful story?
Li Kou today's question 513 Find the value in the lower left corner of the tree
物体结构图,快速图解物体内部结构
元数据管理Apache Atlas编译(内嵌式)部署及遇到各种错误记录
Usage of API interface test ------ post
Const understanding one
MySQL import large files (can be millions or hundreds)
如何更好地组织最小 WEB API 代码结构
Decompile
dolphinscheduler 1.2.1 数据迁移到 dolphinscheduler 2.0.5方法及迁移后数据测试记录
openwrt目录结构
395. redundant path