0% found this document useful (0 votes)
18 views7 pages

Infrared CCFLR

This document describes an infrared remote control circuit project presented by 5 students to fulfill a course requirement. It includes the codes used for the infrared receiver module and microcontroller pins, as well as codes for controlling LED colors and patterns in response to remote control button presses. An image shows the working prototype circuit and team members are pictured.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views7 pages

Infrared CCFLR

This document describes an infrared remote control circuit project presented by 5 students to fulfill a course requirement. It includes the codes used for the infrared receiver module and microcontroller pins, as well as codes for controlling LED colors and patterns in response to remote control button presses. An image shows the working prototype circuit and team members are pictured.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Jose Rizal University

80 Shaw Blvd., Mandaluyong City

Infrared

Presented to the Faculty of the Department of Computer

Engineering College of Computer Studies and Engineering

In Partial Fulfillment of the Requirement for the Course of

CPE C306-301G MICROPROCESSORS

Presented by:
Matthan Dave Cabonegro
Justine Angela Cristobal
Jet Vitorio Fernandez
Louie Jay Layderos
Rom Jordan Resurreccion

Submitted to:
ENGR. Jesse Dela Cruz

05/20/23
Build your circuit like this:

Codes of each keys:

IR remote controller
IR control codes Used for
key
CH FFA25D
CH – FF629D
CH + FFE21D
PREV FF22DD
NEXT FF02FD
PLAY/PAUSE FFC23D
VOL – FFE01F
VOL + FFA857
EQ FF906F ALL ON
0 FF6897 ALL OFF
100 + FF9867 FADE BLUE
200 + FFB04F BLINK RED
1 FF30CF TOGGLE RED
2 FF18E7 TOGGLE GREEN
3 FF7A85 TOGGLE BLUE
4 FF10EF TOGGLE YELLOW
5 FF38C7
6 FF5AA5
7 FF42BD
8 FF4AB5
9 FF52AD

Codes Used:
#include <IRremote.h>

const int RECV_PIN = 3;


IRrecv irrecv(RECV_PIN);
decode_results results;

void setup(){
Serial.begin(9600);
irrecv.enableIRIn();
irrecv.blink13(true);
}

void loop(){
if (irrecv.decode(&results)){
Serial.println(results.value, HEX);
irrecv.resume();
}
}

////AND

#include <IRremote.h>

const int RECV_PIN = 3;


IRrecv irrecv(RECV_PIN);
decode_results results;
const int redPin = 11;
const int greenPin = 10;
const int bluePin = 9;
const int yellowPin = 8;
// the PWM pin the LED is attached to
int brightness = 0; // how bright the LED is
int fadeAmount = 5;
void fadeBlue(){
for(int i=0;i<408;i++){
analogWrite(bluePin, brightness);
// change the brightness for next time through the loop:
brightness = brightness + fadeAmount;

// reverse the direction of the fading at the ends of the fade:


if (brightness <= 0 || brightness >= 255) {
fadeAmount = -fadeAmount;
}
// wait for 30 milliseconds to see the dimming effect
delay(30);
digitalWrite(bluePin, LOW);

}
}
void Blinkred() {
for(int i=0;i<10;i++){

digitalWrite(redPin, HIGH); // turn the LED on (HIGH is the voltage level)


delay(200); // wait for a second
digitalWrite(redPin, LOW); // turn the LED off by making the voltage LOW
delay(200);
} // wait for a second
}

void allOn(){
PORTB = B1111;
}

void allOff(){
PORTB = B0000;
}

void toggleAll(){
PORTB = ~PORTB;
}

void toggleRed(){
boolean x;
x = digitalRead(redPin);
digitalWrite(redPin, !x);
delay(1000);
}

void toggleGreen(){
boolean x;
x = digitalRead(greenPin);
digitalWrite(greenPin, !x);
delay(1000);
}

void toggleBlue(){
boolean x;
x = digitalRead(bluePin);
digitalWrite(bluePin, !x);
delay(1000);
}

void toggleYellow(){
boolean x;
x = digitalRead(yellowPin);
digitalWrite(yellowPin, !x);
delay(1000);
}

void setup(){
irrecv.enableIRIn();
irrecv.blink13(true);
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
pinMode(yellowPin, OUTPUT);
allOn();

void loop(){
if (irrecv.decode(&results)){

switch(results.value){
case 0xFF30CF: //Keypad button "1"
toggleRed();
break;

case 0xFF18E7: //Keypad button "2"


toggleGreen();
break;
case 0xFF7A85: //Keypad button "3"
toggleBlue();
break;
case 0xFF10EF: //Keypad button "4"
toggleYellow();
break;
case 0xFF6897: //Keypad button "0"
allOff();
break;
case 0xFF906F: //Keypad button "EQ"
allOn();
break;
case 0xFF9867:
fadeBlue();
break;
case 0xFFB04F:
Blinkred();
break;
}

irrecv.resume();
}
}

Image of the working prototype:


Team Picture:

You might also like