IRrc
IRrc library for Arduino

IRrc provides classes for controlling a range of infra-red controlled devices such as 3 channel IR model helicopters and others. Such models all use a similar IR encoding scheme which is implemented in the IRrc class. Subclasses such as IRheli provide specific implementations and timings for a specific type of model or other device.

Videos explaining how it works and what you can do with it can be found at:

The version of the package that this documentation refers to can be downloaded from http://www.airspayce.com/mikem/arduino/IRrc/IRrc-1.4.zip You can find the latest version at http://www.airspayce.com/mikem/arduino/IRrc

Tested on Arduino Duemilanove, Diecimila, Mega and Asynclabs Yellowjacket with arduino-0018 on OpenSuSE 11.1 and avr-libc-1.6.2-5.11, cross-avr-binutils-2.19-9.1 and cross-avr-gcc43-4.3.3_20081022-9.3.

IRrc can also interoperate with the RCKit libbary at http://www.airspayce.com/mikem/arduino/RCKit to create infra-red models that can be controlled from your iPhone with the RCTx app from the Apple App Store at http://itunes.apple.com/app/rctx/id377833472?mt=8

The Infra-Red protocol is a 38kHz carrier, modulated with a preamble, a variable number of octets followed by a postamble. Timings are specific for a particular model.

The IRheli class provides a specific implementation for a Chinese 3 channel co-axial model helicopter.

Basic usage

You must instantiate a subclass of the IRrc class, such as the IRheli class. By default it will control an infra-red transmitter connected to Arduino digital output pin 3 (pin 9 on Arduino Mega). You then call sendMessage() (or a derivative) to send messages to the controlled device. IRrc will then modulate the infra-red tranmitter on the output pin according to the timings defined by the subclass.

The carrier output is from PWM timer 2, with 50% duty cycle. It is turned on and off according to the bit timings and the bits in the message to be transmitted.

Example Sketches

2 Example Arduino sketches are provided in the examples directory of the distribution to demonstrate the use of these classes:

Electrical

You can get a short range IR output by connecting an IR LED directly to an Arduino output pin and ground. This will provide about 25mA of drive for the LED, which is about 1/40th of what a commonly available IR LED is capable of, but will work for short ranges.

A better alternative for greater range is to use a transistor driver to drive a higher current through several IR LEDs. See LED-Output.pdf for sample circuit diagrams for LED connections.

Installation

Install in the usual way: unzip the distribution zip file to the libraries sub-folder of your sketchbook.

Author:
Mike McCauley (mikem.nosp@m.@air.nosp@m.spayc.nosp@m.e.co.nosp@m.m)

This software and is Copyright (C) 2010 Mike McCauley. Use is subject to license conditions. The main licensing options available are GPL V2 or Commercial:

Open Source Licensing GPL V2
This is the appropriate option if you want to share the source code of your application with everyone you distribute it to, and you also want to give them the right to share who uses it. If you wish to use this software under Open Source Licensing, you must contribute all your source code to the open source community in accordance with the GPL Version 2 when your application is distributed. See http://www.gnu.org/copyleft/gpl.html
Commercial Licensing
This is the appropriate option if you are creating proprietary applications and you are not prepared to distribute and share the source code of your application. Contact info@.nosp@m.airs.nosp@m.payce.nosp@m..com for details.
Revision History
Version:
1.0 Initial release
1.1 Added videos and USBJoystickHeli example
1.2 Compiles under Ardiono 1.0
1.3 Updated HeliRCRx example for latest version of RCKit.
1.4 Updated author and distribution location details to airspayce.com