hey guys im new to the forum and am having some issues..im trying to recreate user Furqan's project
it some remote controlled leds the problem is when i paste the code i get the following error:
sketch_mar25a.cpp:12:10: error: #include expects "FILENAME" or
sketch_mar25a:22: error: 'decode_results' does not name a type
sketch_mar25a.cpp: In function 'void setup()':
sketch_mar25a:27: error: 'irrecv' was not declared in this scope
sketch_mar25a.cpp: In function 'void loop()':
sketch_mar25a:37: error: 'irrecv' was not declared in this scope
sketch_mar25a:37: error: 'ampresults' was not declared in this scope
sketch_mar25a:38: error: 'results' was not declared in this scope
here is the code
/* 5 Channel ir remote control
Created by Asghar Furqan
A fully open-sourse program!
---------------------------------------------------------
circuit:
ir module connected to pin 2(Digital)
led 1-2-3-4-5 connected to pin 3-4-5-6-7
*/
#include <IRremote.h>
int RECV_PIN = 2;
int led1 = 7;
int led2 = 3;
int led3 = 4;
int led4 = 5;
int led5 = 6;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the ir receiver
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(led4, OUTPUT);
pinMode(led5, OUTPUT);
}
void loop() {
if (irrecv.decode(&results)) {
Serial.println(results.value, DEC);
if(results.value == 16705559) //if you want to configure with your remote controll change the results.value
digitalWrite(led1, HIGH); // set the LED on
if (irrecv.decode(&results)) {
Serial.println(results.value, DEC);
if(results.value == 16656599)
digitalWrite(led1, LOW); // set the LED off
irrecv.resume(); // Receive the next value
if(results.value == 16672919)
digitalWrite(led2, HIGH); // set the LED on
if(results.value == 16697399)
digitalWrite(led2, LOW); // set the LED off
irrecv.resume(); // Receive the next value
if(results.value == 16689239)
digitalWrite(led3, HIGH); // set the LED on
if(results.value == 16664759)
digitalWrite(led3, LOW); // set the LED off
irrecv.resume(); // Receive the next value
if(results.value == 16668839)
digitalWrite(led4, HIGH); // set the LED on
if(results.value == 16676999)
digitalWrite(led4, LOW); // set the LED off
irrecv.resume(); // Receive the next value
if(results.value == 16674959)
digitalWrite(led5, HIGH); // set the LED on
if(results.value == 16650479)
digitalWrite(led5, LOW); // set the LED off
irrecv.resume(); // Receive the next value
}
}
}
also my ir reciever get really hot fast it seems to be pretty standard there are no product markings on it, its black and has 3 pins i pulled it off a dvd player
any help or guidance would be appreciated thanks!