资源简介
红外收发库文件,默认载波38KHz;
在别处也可下载;
代码片段和文件信息
/*
* 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 2013-11-23 22:08 Arduino_IRremote_master\
文件 28174 2012-08-13 23:18 Arduino_IRremote_master\IRremote.cpp
文件 3867 2012-08-13 23:18 Arduino_IRremote_master\IRremote.h
文件 13639 2012-11-09 21:18 Arduino_IRremote_master\IRremoteInt.h
文件 24356 2012-08-13 23:18 Arduino_IRremote_master\LICENSE.txt
目录 0 2013-11-23 22:08 Arduino_IRremote_master\examples\
目录 0 2013-11-23 22:08 Arduino_IRremote_master\examples\GreeIRReicive\
文件 2 2013-09-18 06:03 Arduino_IRremote_master\examples\GreeIRReicive\GreeIRReicive.ino
目录 0 2013-11-23 22:08 Arduino_IRremote_master\examples\GreeIRsend\
文件 1457 2013-09-12 01:04 Arduino_IRremote_master\examples\GreeIRsend\GreeIRsend.ino
目录 0 2013-11-23 22:08 Arduino_IRremote_master\examples\IRrecord\
文件 4587 2012-08-13 23:18 Arduino_IRremote_master\examples\IRrecord\IRrecord.ino
目录 0 2013-11-23 22:08 Arduino_IRremote_master\examples\IRrecvDemo\
文件 545 2012-08-13 23:18 Arduino_IRremote_master\examples\IRrecvDemo\IRrecvDemo.ino
目录 0 2013-11-23 22:08 Arduino_IRremote_master\examples\IRrecvDump\
文件 2075 2012-08-13 23:18 Arduino_IRremote_master\examples\IRrecvDump\IRrecvDump.ino
目录 0 2013-11-23 22:08 Arduino_IRremote_master\examples\IRrelay\
文件 2086 2012-08-13 23:18 Arduino_IRremote_master\examples\IRrelay\IRrelay.ino
目录 0 2013-11-23 22:08 Arduino_IRremote_master\examples\IRsendDemo\
文件 447 2012-08-13 23:18 Arduino_IRremote_master\examples\IRsendDemo\IRsendDemo.ino
目录 0 2013-11-23 22:08 Arduino_IRremote_master\examples\IRtest\
文件 4592 2012-08-13 23:18 Arduino_IRremote_master\examples\IRtest\IRtest.ino
目录 0 2013-11-23 22:08 Arduino_IRremote_master\examples\IRtest2\
文件 8160 2012-08-13 23:18 Arduino_IRremote_master\examples\IRtest2\IRtest2.ino
目录 0 2013-11-23 22:08 Arduino_IRremote_master\examples\JVCPanasonicSendDemo\
文件 929 2012-08-13 23:18 Arduino_IRremote_master\examples\JVCPanasonicSendDemo\JVCPanasonicSendDemo.ino
文件 977 2012-08-13 23:18 Arduino_IRremote_master\keywords.txt
文件 700 2012-08-13 23:18 Arduino_IRremote_master\readme.txt
相关资源
- Arduino中文手册
- Arduino Mini 资料
- 基于Arduino与LabVIEW的数据采集系统.v
- Arduino通过Ethernet扩展板实现网络远程
- 基于Arduino的-亚博 BST-BATCAR 智能小车底
- Arduino的PID库
- 基于labview和arduinod的超声波测距
- Arduino UNO R3开发板原理图
- 移送气象站 arduino代码
- Arduino Nano v3.0介绍及原理图pdf
- codesys库函数说明
- arduino pro mini 封装、pcb图及原理图
- arduino mega 2560 原理图
- 自平衡小车arduino+mpu6050+卡尔曼滤波
- 库函数驱动外设的应用:应用STM32的
- HMC5883L的Arduino库
-
DFPla
yer_Mini_mp3 arduino 库文件 - arduino avrdude 5.11.1 for Windows with JesseJ
- Arduino I2Cdev库
- arduino鼠标点击绝对坐标
- EMCV库函数
- 74LS47驱动7段数码管实验
- usbser.sys和mdmcpq.PNF和mdmcpq.inf还有另一
- 自动计算mpu6050的偏移量MPU6050_calibra
- XLoader hex文件
- arduino-uno-r3 电路图
- STM32库函数助手
- 颜色传感器ARDUINO代码
- PS2手柄 - arduino版本例程
- RFID.h RC522
评论
共有 条评论