当前位置:网站首页>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);
}
}
如有帮助,麻烦点赞收藏,如遇问题,请直接私信。
边栏推荐
- AlertManager告警的单独使用及prometheus配置告警规则使用
- Small problems in the spoole framework for TCP communication in PHP
- dolphinscheduler 1.2.1 数据迁移到 dolphinscheduler 2.0.5方法及迁移后数据测试记录
- 2022-06-22:golang选择题,以下golang代码输出什么?A:3;B:1;C:4;D:编译失败。 package main import ( “fmt“ ) func mai
- Alkylation process test questions and simulation test in 2022
- Pads and flash symbols in cadence
- How to solve multi-channel customer communication problems in independent stations? This cross-border e-commerce plug-in must be known!
- Can bus Basics
- 微信小程序:未来老婆查询生成器
- Cloud native database is in full swing, and the future can be expected
猜你喜欢

接收传来得文件并下载(简单用法)a标签

微信小程序:微信也可以发闪照了闪照制作生成微信小程序源码下载,自定义闪照时间

【OFDM通信】基于matlab OFDM多用户资源分配仿真【含Matlab源码 1902期】

openwrt目录结构

The solution to prompt "this dictionary creation could be rewritten as a dictionary literal" when updating the dictionary key value in pychart

微信小程序:拼图工具箱

微信小程序:爱情保证书制作生成

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

Notepad++ find replace group replace retain

Transformers中的动态学习率
随机推荐
How to solve multi-channel customer communication problems in independent stations? This cross-border e-commerce plug-in must be known!
《微信小程序-基础篇》带你了解小程序的路由系统(二)
Flask基础:环境搭建+配置+URL与试图之间的映射+重定向+数据库连接
微信小程序:爱情保证书制作生成
A mvc5+easyui enterprise rapid development framework source code BS framework source code
How to make social media the driving force of cross-border e-commerce? This independent station tool cannot be missed!
Precautions for running high-frequency and high-speed signal lines near PCB board - basic principles for high-frequency and high-speed signal design
Shadertoy basic teaching 02. Drawing smiling faces
ZK has a node reporting it is possible not running and the log has no obvious error
rtklib2.4.3 b34的一个与编译器有关的bug
Thinkphp6 template replacement
如何更好地组织最小 WEB API 代码结构
ICER skills 03design compile
[paper reading] semi supervised learning with ladder networks
Decompile
The solution to prompt "this dictionary creation could be rewritten as a dictionary literal" when updating the dictionary key value in pychart
centos7部署docker,安装mysql
VGg Chinese herbal medicine identification
QT elidedtext only works for Chinese conformity, but not for English
Ad9 tips