Arduino IR Remote Control Training
Arduino IR Remote Control Training
TAHRI KHALID
J9
IRRemote control
SUMMARY
Hardware :
IR sensor
TechnologiesIR
Software:
Infrared Library
TP
SENSOR AND TECHNOLOGY IR
j
Applications
WS 1838B
IR Receiver IR emitter
IR technology
There are many protocols for
transmissions (NEC, Sony SIRC, Philips RC5,
Philips RC6, raw data...) and several
ways to code information.
Some protocols require repeating three
times the information.
Philips RC5 Protocol
IRremote
[Link]
Support protocols
#include<IRremoteInt.h>
#include<IRremote.h>
IRrecvirrecv(13);
decode_resultsresults;
void setup()
{
[Link](9600);
[Link]();// Start the receiver
}
voidloop() {
if ([Link]( &results )) {
[Link]([Link], HEX);
[Link]();// Receive the next value
}
delay(100);
}
#include<IRremote.h>
IRsendirsend;
void setup()
{
}
voidloop() {
for (int i = 0; i < 3; i++) {
[Link](0xa90, 12);
delay(40);
}
delay(5000); //5 second delay between each signal burst
}
#include <IRremoteInt.h>
#include <IRremote.h>
void setup()
{
[Link](); // Start the receiver
pinMode(5, OUTPUT);
Set pin 6 as OUTPUT;
}
void loop() {
if ([Link]( &results )) {
if([Link] == 0x20DF8877)
{
led1=!led1;
digitalWrite(5,led1);
}
if([Link] == 0x20DF48B7)
{
led2=!led2;
digitalWrite(6,led2);
}
[Link](); // Receive the next value
}
delay(100);
}