IRrc
|
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.
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.
2 Example Arduino sketches are provided in the examples directory of the distribution to demonstrate the use of these classes:
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.
Install in the usual way: unzip the distribution zip file to the libraries sub-folder of your sketchbook.
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: