Pages: [1]   Go Down
Author Topic: hey guys some help?  (Read 1075 times)
0 Members and 1 Guest are viewing this topic.
mtl
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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: smiley-eek


sketch_mar25a.cpp:12:10: error: #include expects "FILENAME" or <FILENAME>
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



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!
« Last Edit: March 28, 2011, 02:41:59 pm by jaimehardtimes » Logged

stay rebel stay red

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12483
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Do you have copied the file - IRremote.h ?
It is porbably part of a library you need to use

Please modify your message, select the code and press the # button for proper layout, thanx
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Newcastle, England
Offline Offline
Sr. Member
****
Karma: 2
Posts: 489
Always learning!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

At the top of the code, it says #include<IRremote.h>. This adds the functions of IR remote to your code. Check that you have th IR remote library in yout libraries file, then try again. (You will have to restart the IDE to get the new library to work).
Without having the library "IR remote" in your folder, the IDE will be looking for something that is not there, and it will not work.

Onions.
Logged

My website: http://www.harryrabbit.co.uk/electronics/home.html Up and running now! (Feel free to look round!) smiley-grin

0
Offline Offline
Full Member
***
Karma: 0
Posts: 112
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1251570417

Would be a good start...
Logged

No trees were harmed by the transmission of this message. However a few million electrons were temporarily inconvenienced.

mtl
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks guys adding the library's solved the problem

it is receiving the remote signals now...just cant seem to get the leds to light up...i will plug away at it some more i guess

again thanks for the quick help!  smiley-mr-green
Logged

stay rebel stay red

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12483
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
just cant seem to get the leds to light up

IR means infraRed - you can't see them - or are you a superhero smiley-wink

Serious,

if(results.value == 16705559L)   ==>  needs an L for Long 16705559L

maybe that helps?
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Pages: [1]   Go Up
Jump to: