资源简介
Arduino红外传感器库文件 里面附有红外传感器的示例代码 任意红外遥控器的解码
代码片段和文件信息
/*
* IRremote
* Version 0.11 August 2009
* Copyright 2009 Ken Shirriff
* For details see http://arcfn.com/2009/08/multi-protocol-infrared-remote-library.html
*
* Modified by Paul Stoffregen to support other boards and timers
* Modified by Mitra Ardron
* Added Sanyo and Mitsubishi controllers
* Modified Sony to spot the repeat codes that some Sony‘s send
*
* Interrupt code based on NECIRrcv by Joe Knapp
* http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1210243556
* Also influenced by http://zovirl.com/2008/11/12/building-a-universal-remote-with-an-arduino/
*
* JVC and Panasonic protocol added by Kristian Lauszus (Thanks to zenwheel and other people at the original blog post)
*/
#include “IRremote.h“
#include “IRremoteInt.h“
// Provides ISR
#include
volatile irparams_t irparams;
// These versions of MATCH MATCH_MARK and MATCH_SPACE are only for debugging.
// To use them set DEBUG in IRremoteInt.h
// Normally macros are used for efficiency
#ifdef DEBUG
int MATCH(int measured int desired) {
Serial.print(“Testing: “);
Serial.print(TICKS_LOW(desired) DEC);
Serial.print(“ <= “);
Serial.print(measured DEC);
Serial.print(“ <= “);
Serial.println(TICKS_HIGH(desired) DEC);
return measured >= TICKS_LOW(desired) && measured <= TICKS_HIGH(desired);
}
int MATCH_MARK(int measured_ticks int desired_us) {
Serial.print(“Testing mark “);
Serial.print(measured_ticks * USECPERTICK DEC);
Serial.print(“ vs “);
Serial.print(desired_us DEC);
Serial.print(“: “);
Serial.print(TICKS_LOW(desired_us + MARK_EXCESS) DEC);
Serial.print(“ <= “);
Serial.print(measured_ticks DEC);
Serial.print(“ <= “);
Serial.println(TICKS_HIGH(desired_us + MARK_EXCESS) DEC);
return measured_ticks >= TICKS_LOW(desired_us + MARK_EXCESS) && measured_ticks <= TICKS_HIGH(desired_us + MARK_EXCESS);
}
int MATCH_SPACE(int measured_ticks int desired_us) {
Serial.print(“Testing space “);
Serial.print(measured_ticks * USECPERTICK DEC);
Serial.print(“ vs “);
Serial.print(desired_us DEC);
Serial.print(“: “);
Serial.print(TICKS_LOW(desired_us - MARK_EXCESS) DEC);
Serial.print(“ <= “);
Serial.print(measured_ticks DEC);
Serial.print(“ <= “);
Serial.println(TICKS_HIGH(desired_us - MARK_EXCESS) DEC);
return measured_ticks >= TICKS_LOW(desired_us - MARK_EXCESS) && measured_ticks <= TICKS_HIGH(desired_us - MARK_EXCESS);
}
#endif
void IRsend::sendNEC(unsigned long data int nbits)
{
enableIROut(38);
mark(NEC_HDR_MARK);
space(NEC_HDR_SPACE);
for (int i = 0; i < nbits; i++) {
if (data & TOPBIT) {
mark(NEC_BIT_MARK);
space(NEC_ONE_SPACE);
}
else {
mark(NEC_BIT_MARK);
space(NEC_ZERO_SPACE);
}
data <<= 1;
}
mark(NEC_BIT_MARK);
space(0);
}
void IRsend::sendSony(unsigned long data int nbits) {
enableIROut(40);
mark(SONY_HDR_MARK);
space(SONY_HDR_SPACE);
data = data << (32 - nbits);
for (int i = 0; i < nb
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-01-25 13:49 IRremote\
目录 0 2018-01-25 13:49 IRremote\examples\
目录 0 2018-01-25 13:49 IRremote\examples\IRrecord\
文件 4587 2013-12-29 13:58 IRremote\examples\IRrecord\IRrecord.ino
目录 0 2018-01-25 13:49 IRremote\examples\IRrecvDemo\
文件 545 2013-12-29 13:58 IRremote\examples\IRrecvDemo\IRrecvDemo.ino
目录 0 2018-01-25 13:49 IRremote\examples\IRrecvDump\
文件 2075 2013-12-29 13:58 IRremote\examples\IRrecvDump\IRrecvDump.ino
目录 0 2018-01-25 13:49 IRremote\examples\IRrelay\
文件 2086 2013-12-29 13:58 IRremote\examples\IRrelay\IRrelay.ino
目录 0 2018-01-25 13:49 IRremote\examples\IRsendDemo\
文件 447 2013-12-29 13:58 IRremote\examples\IRsendDemo\IRsendDemo.ino
目录 0 2018-01-25 13:49 IRremote\examples\IRtest2\
文件 8160 2013-12-29 13:58 IRremote\examples\IRtest2\IRtest2.ino
目录 0 2018-01-25 13:49 IRremote\examples\IRtest\
文件 4592 2013-12-29 13:58 IRremote\examples\IRtest\IRtest.ino
目录 0 2018-01-25 13:49 IRremote\examples\JVCPanasonicSendDemo\
文件 929 2013-12-29 13:58 IRremote\examples\JVCPanasonicSendDemo\JVCPanasonicSendDemo.ino
文件 28174 2013-12-29 13:58 IRremote\IRremote.cpp
文件 3867 2013-12-29 13:58 IRremote\IRremote.h
文件 13639 2013-12-29 13:58 IRremote\IRremoteInt.h
文件 977 2013-12-29 13:58 IRremote\keywords.txt
文件 24356 2013-12-29 13:58 IRremote\LICENSE.txt
文件 700 2013-12-29 13:58 IRremote\readme
- 上一篇:DHT11库文件和
- 下一篇:biaoche.zip
相关资源
- DHT11库文件和
- arduino pid 调节 平衡小车代码
- Arduino全地形小车代码
- 基于51单片机多传感器楼道照明控制系
- Arduino红外循迹小车
- 基于Arduino的温湿度系统设计
- arduino使用红外传感器实现循迹适合新
- Arduboy2库技术文档.pdf
- Arduino LiquidCrystal_I2C库
- arduino使用串口语音模块,解决汉子编
- Arduino并行控制多个舵机
- Arduino 自动水阀控制
- arduino可调速度电机程序TB6612FNG驱动
- PPT控制器—源程序
- 树莓派+OpenCV+Arduino实现二维码颜色识
- Arduino uno 控制42步进电机TB6560驱动模块
- Arduino UNO 控制全彩RGB点阵条屏单元板
- EESkill LCD2004液晶模块ARDUINO连接应用
- u8glib_arduino
- Arduino DHT11
- dht11头文件
- arduino 定时器库
- motor_key_location.ino
- Arduboy游戏资源
- nokia5110 arduino 库文件
- Arduino DHT11温湿度传感器库文件
- Visual.Micro.Arduino 最新1912_28_2 含替换文
- 基于Arduino的蓝牙小车报告、代码
- Arduino开发实战指南:AVR篇.pdf
- arduino编程参考手册中文版
评论
共有 条评论