• 大小: 23.11MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-07-15
  • 语言: 其他
  • 标签: 智能小车  

资源简介

红外接收,蓝牙遥控,寻光循迹,超声避障,四为一体完全实用代码!

资源截图

代码片段和文件信息

/*
 * IRremote
 * Version 0.11 August 2009
 * Copyright 2009 Ken Shirriff
 * For details see http://arcfn.com/2009/08/multi-protocol-infrared-remote-library.html
 *
 * 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/
 */

#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 < nbits; i++) {
    if (data & TOPBIT) {
      mark(SONY_ONE_MARK);
      space(SONY_HDR_SPACE);
    } 
    else {
      mark(SONY_ZERO_MARK);
      space(SONY_HDR_SPACE);
    }
    data <<= 1;
  }
}

void IRsend::sendRaw(unsigned int buf[] int len int hz)
{
  e

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件    2673054  2011-11-27 17:51  智能小龟学习套件\第六节-4合一多功能车程序\硬體架構圖.JPG

     文件      15954  2013-04-09 09:44  智能小龟学习套件\第六节-4合一多功能车程序\four_in_one_demo\four_in_one_demo.pde

     文件    1809688  2013-03-07 15:24  智能小龟学习套件\第一节-l298电机驱动板调试\L298N双H桥直流电机驱动板手册.pdf

     文件       1914  2013-04-09 09:20  智能小龟学习套件\第一节-l298电机驱动板调试\_298n_demo\_298n_demo.pde

     文件       2737  2013-04-09 09:29  智能小龟学习套件\第二节-循迹智能车\tracking_car\tracking_car.pde

     文件        330  2013-04-09 09:24  智能小龟学习套件\第二节-循迹智能车\TCRT5000_DEMO\TCRT5000_DEMO.pde

     文件       7741  2013-04-09 09:32  智能小龟学习套件\第三节-超声波智能车\ultrasonic_car\ultrasonic_car.pde

     文件       1648  2013-04-09 09:34  智能小龟学习套件\第四节-红外遥控智能车\IRRemote_test\IRRemote_test.pde

     文件       3178  2013-04-09 09:38  智能小龟学习套件\第四节-红外遥控智能车\IRremote_car\IRremote_car.pde

     文件      16763  2009-09-06 12:42  智能小龟学习套件\第四节-红外遥控智能车\IRremote\IRremote.cpp

     文件       2670  2009-09-05 23:55  智能小龟学习套件\第四节-红外遥控智能车\IRremote\IRremote.h

     文件       3273  2009-09-05 23:55  智能小龟学习套件\第四节-红外遥控智能车\IRremote\IRremoteInt.h

     文件        761  2009-07-27 22:16  智能小龟学习套件\第四节-红外遥控智能车\IRremote\keywords.txt

     文件      24356  2009-05-30 12:14  智能小龟学习套件\第四节-红外遥控智能车\IRremote\LICENSE.txt

     文件       4782  2009-07-29 21:55  智能小龟学习套件\第四节-红外遥控智能车\IRremote\examples\IRtest\IRtest.pde

     文件        450  2009-08-28 18:28  智能小龟学习套件\第四节-红外遥控智能车\IRremote\examples\IRsendDemo\IRsendDemo.pde

     文件       3479  2011-08-05 23:18  智能小龟学习套件\第四节-红外遥控智能车\IRremote\examples\IRrelayX6\IRrelayX6.pde

     文件       2087  2009-08-29 23:28  智能小龟学习套件\第四节-红外遥控智能车\IRremote\examples\IRrelay\IRrelay.pde

     文件       1739  2009-08-28 18:43  智能小龟学习套件\第四节-红外遥控智能车\IRremote\examples\IRrecvDump\IRrecvDump.pde

     文件        546  2009-08-28 18:28  智能小龟学习套件\第四节-红外遥控智能车\IRremote\examples\IRrecvDemo\IRrecvDemo.pde

     文件       4595  2009-09-06 12:59  智能小龟学习套件\第四节-红外遥控智能车\IRremote\examples\IRrecord\IRrecord.pde

     文件    1426944  2011-10-14 14:13  智能小龟学习套件\第五节-蓝牙遥控智能车\蓝牙模块介绍.doc

     文件    1089024  2011-07-28 12:29  智能小龟学习套件\第五节-蓝牙遥控智能车\Arduino通过蓝牙控制直流电机.doc

     文件     648704  2013-02-18 14:59  智能小龟学习套件\第五节-蓝牙遥控智能车\Arduino通过蓝牙与pc机通信.doc

     文件    2243595  2011-11-05 10:13  智能小龟学习套件\第五节-蓝牙遥控智能车\HC系列蓝牙产品选型指南及用户使用指导说明书201104修订-1.pdf

     文件       1043  2013-01-22 16:28  智能小龟学习套件\第五节-蓝牙遥控智能车\sscom.ini

     文件     789504  2011-11-05 09:26  智能小龟学习套件\第五节-蓝牙遥控智能车\串口调试软件SSCOM32.EXE-北京欣立伟科技有限公司.EXE

     文件        274  2013-04-09 09:40  智能小龟学习套件\第五节-蓝牙遥控智能车\CODE\bluetooth_demo\bluetooth_demo.pde

     文件       1665  2013-04-09 09:41  智能小龟学习套件\第五节-蓝牙遥控智能车\CODE\bluetooth_car\bluetooth_car.pde

     文件      62950  2012-05-12 10:38  智能小龟学习套件\第五节-蓝牙遥控智能车\APK\蓝牙串口助手+BluetoothSPP.apk

............此处省略32个文件信息

评论

共有 条评论