LED control using IR Remote CloudX

  • img
Project Details

Infrared (IR) communication is a very common wireless communication technology. IR communication is an easy to use and inexpensive wireless communication. IR Communication generally comprises of IR Transmitter and Receiver.

 

Circuit Diagram

 

Code

 

#include <CloudX\IR_NECReceiver.h> 

long buttonPress;

setup(){
//setup here
IR_init(16);
portMode(1, OUTPUT);
portWrite(0,0);
loop(){
//Program here
while(pin16);
buttonPress = IR_read();
if (buttonPress is 0xFF30CF)
pin1 = ~pin1; //1
else if (buttonPress is 0xFF18E7)
pin2 = ~pin2; //2
else if (buttonPress is 0xFF7A85)
pin3 = ~pin3; //3
else if (buttonPress is 0xFF10EF)
pin4 = ~pin4; //4
else if (buttonPress is 0xFF38C7)
pin5 = ~pin5; //5
else if (buttonPress is 0xFF5AA5)
pin6 = ~pin6; //6
else if (buttonPress is 0xFF52AD)
PORTB = ~PORTB; //9
}
}

 

Share this with friends