Arduino 433 自定义接受
/*
Simple example for receiving https://github.com/sui77/rc-switch/
*/ #include <RCSwitch.h>
#define led1 10
#define led2 11
RCSwitch mySwitch = RCSwitch(); void setup() {
Serial.begin(9600);
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
mySwitch.enableReceive(0); // Receiver on interrupt 0 => that is pin #2
} void loop() {
if (mySwitch.available()) { int value = mySwitch.getReceivedValue(); if (value == 0) {
Serial.print("Unknown encoding");
} else {
if (value ==17) {
if( digitalRead(led1)==0){
digitalWrite(led1, HIGH);
}
else{
digitalWrite(led1, LOW);
}
}
if (value ==18) { if( digitalRead(led2)==0){
digitalWrite(led2, HIGH);
}
else{
digitalWrite(led2, LOW);
} }
Serial.print("Received ");
Serial.print( mySwitch.getReceivedValue() );
Serial.print(" / ");
Serial.print( mySwitch.getReceivedBitlength() );
Serial.print("bit ");
Serial.print("Protocol: ");
Serial.println( mySwitch.getReceivedProtocol() );
} mySwitch.resetAvailable();
}
}
Arduino 433 自定义接受的更多相关文章
- Arduino 433 自定义发射
/* This is a minimal sketch without using the library at all but only works for the 10 pole dip swit ...
- Arduino 433 + 串口
http://www.freebuf.com/articles/wireless/105398.html /*本作品使用的例程中包含RCSwitch库文件用于信号的解码和编码发送*/ #include ...
- 433 模块 ARDUINO测试
实验硬件 发射端 Arduino + 433超外差发射机 高,低电平和悬空三种模式切换 由简单的官方库修改 /* This is a minimal sketch without using ...
- Arduino语法-变量和常量
变量的声明: int led=11 一般变量的声明方法为类型名+变量名+变量初始化值.变量名的写法约定为首字母小写 变量的作用范围又称为作用域,变量的作用范围与该变量在哪儿声明有关,大致分为如下两种: ...
- @RequestBody 注意的问题
contentType : "application/json", //只能是这个 RequestBody 不能和form/data共存: @RequestMapping(valu ...
- springboot+springsecurity+thymeleaf
来源:听秦疆老师的课笔记 springsecurity是一个权限管理框架,用来授权,认证,加密等等......类似的工具还有shiro 1.整合 我用的是springboot2.2.0版本,导入以下依 ...
- jackson处理日期异常
原 jackson处理日期异常 2018年01月09日 10:50:19 阅读数:70 1.异常信息 2.原因 默认情况下,fasterxml json只支持几种format,但是肯定不支持" ...
- 《流畅的Python》第三部分 把函数视作对象 【一等函数】【使用一等函数实现设计模式】【函数装饰器和闭包】
第三部分 第5章 一等函数 一等对象 在运行时创建 能赋值给变量或数据结构中的元素 能作为参数传递给函数 能作为函数的返回结果 在Python中,所有函数都是一等对象 函数是对象 函数本身是 func ...
- (二)React Ant Design Pro + .Net5 WebApi:前端环境搭建
首先,你需要先装一个Nodejs,这是基础哦.如果没有这方面知识的小伙伴可以在园子里搜索cnpm yarn等关键字,内容繁多,此不赘述,参考链接 一. 简介 1. Ant Design Pro v5 ...
随机推荐
- .8-浅析webpack源码之Tapable介绍
Tapable工具 完成webpack默认参数注入后,下一步虽然是 new Compiler() ,但是这东西不是一下可以讲完的,复杂的一批. 不如先从工具入手,分块讲解compiler,首先来看看事 ...
- IdentityServer4 中文文档 -7- (简介)贡献
IdentityServer4 中文文档 -7- (简介)贡献 原文:http://docs.identityserver.io/en/release/intro/contributing.html ...
- Spark练习代码
1.scalaWordCount package com._51doit.spark.day1 import org.apache.spark.rdd.RDDimport org.apache.spa ...
- Ocelot中文文档-Getting Started
Getting Started Ocelot是只在.NET Core运行,目前基于netstandard2.0构建的.如果Ocelot适合你们的话,那么这个文档会有所帮助. .NET Core 2.0 ...
- MDK5 新建工程提示报错:Load PDSC Dubug Description faild
File : D:\Keil_v5\ARM\PACK\Keil\STM32F0xx_DFP\2.0.0\Keil.STM32F0xx_DFP.pdsc Sequence : CheckID Conte ...
- JS如何判断一个数组是否为空、是否含有某个值
一.js判断数组是否为空 方法一: arr.length let arr = []; if (arr.length == 0){ console.log("数组为空") }els ...
- PHP7.27: connect mysql 5.7 using new mysqli
<!doctype html> <html> <head> <meta name="viewport" content="wid ...
- 【读书笔记】iOS-设计简单的Frenzic式益智游戏
如果你决定用UIView动画或Core Animation,一定要编写一些测试用例,模拟游戏可能遇到的要求最高的动画,另外不要忘记播放声音.不要等到最后才增加声音,因为在iPhone上播放音乐和音效确 ...
- mysql之行(记录)的详细操作
在Mysql管理软件中, 可以通过sql语句中的dml语言来实现数据的操作, 包括 使用INSERT实现数据的插入 UPDATE实现数据的更新 使用DELETE实现数据的删除 使用SELECT查询数据 ...
- 安卓开发_浅谈Notification(通知栏)
Notification通知栏是显示在手机状态的消息,代表一种全局效果的通知 快速创建一个Notification的步骤简单可以分为以下四步: 第一步:通过getSystemService()方法得到 ...