IRremote Library, Send & Receive Infrared Remote Control - PJRC
Maybe your like
| Download: | Included with the Teensyduino Installer Latest Developments on Github |
Hardware Requirements
For transmitting, a single Infrared LED and resistor are needed. For receiving, an IR receiver module with internal bandpass filter is needed.TODO: Add part numbers of known-good infrared LEDs and receivers. The LED in this photo is Lumex OED-EL-8L (Digikey 67-1000-ND) and the receiver is probably Sharp GP1UD281YK0F (now discontinued, Digikey 425-1987-ND).
TODO: Test Vishay TSOP39338 receiver (Digikey 751-1390-5-ND). It's very likely to work. Update this photo. Maybe PJRC should sell a known-good LED & receiver pair?
|
For transmitting, you must connect the LED to a specific pin. The receiver output may be connected to any pin.
| Board | ReceivePin | TransmitPin | TimerUsed | PWM PinsDisabled |
|---|---|---|---|---|
| Teensy 4.1 / 4.0 | Any | 8 | FlexPWM1.3 | None |
| Teensy 3.6 / 3.5 | Any | 5 | CMT | None |
| Teensy 3.2 / 3.1 | Any | 5 | CMT | None |
| Teensy 3.0 | Any | 5 | CMT | None |
| Teensy LC | Any | 16 | FTM1 | 17 |
| Teensy 2.0 | Any | 10 | 4 | 12 |
| Teensy 1.0 | Any | 17 | 1 | 15, 18 |
| Teensy++ 2.0 | Any | 1 | 2 | 0 |
| Teensy++ 1.0 | Any | 1 | 2 | 0 |
Basic Usage
IRremote acts like 2 libraries, one for sending and one for receiving. Usually it's easiest to find the codes to transmit by first using the receiver.Receiving
IRrecv irrecv(receivePin)Create the receiver object, using a name of your choice.
irrecv.enableIRIn()Begin the receiving process. This will enable the timer interrupt which consumes a small amount of CPU every 50 µs.
irrecv.decode(&results)Attempt to receive a IR code. Returns true if a code was received, or false if nothing received yet. When a code is received, information is stored into "results".
results.decode_type: Will be one of the following: NEC, SONY, RC5, RC6, or UNKNOWN. results.value: The actual IR code (0 if type is UNKNOWN) results.bits: The number of bits used by this code results.rawbuf: An array of IR pulse times results.rawlen: The number of items stored in the array
Tag » Arduino Ir Remote Send And Receive
-
How To Send And Receive Data Over IR Signals With An Arduino
-
Use An IR Remote Transmitter And Receiver With Arduino
-
IRremote Arduino Library - GitHub
-
How To Set Up An IR Remote And Receiver On An Arduino
-
Arduino IR Remote Controller Tutorial - Setup And Map Buttons
-
Sending IR Codes | Using An Infrared Library On Arduino
-
How To Send Arduino IR Remote Signals
-
Arduino IRremote Send And Receive Simultaneously - Stack Overflow
-
A Multi-Protocol Infrared Remote Library For The Arduino
-
Arduino: How To Process Infrared Signals From A Remote Control
-
How To Set Up Infrared (IR) Communication With Arduino - YouTube
-
Using IR Remote Controls With Arduino | DroneBot Workshop
-
IRRemote Send And Receive Same Arduino
-
IR Communication - Sparkfun Learn