智能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
 *
 * 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_demofour_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  智能小龟学习套件第二节-循迹智能车 racking_car racking_car.pde

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

     文件       4595  2009-09-06 12:59  智能小龟学习套件第四节-红外遥控智能车IRremoteexamplesIRrecordIRrecord.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  智能小龟学习套件第五节-蓝牙遥控智能车CODEluetooth_demoluetooth_demo.pde

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

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

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

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)