Go Down

Topic: Questions with IR remote (Read 2105 times) previous topic - next topic

tomyhu1995

Hi,

I want to use my arduino UNO to make a decode device. I found an example code and a some steps which can teach me how to build. In those steps, it told me that I need to download a folder called IRremote and install it in this route /Users/username/Documents/Arduino/libraries.

When I finished write the coding and tried to verify, Arduino IDE said that 'IRrecv' does not name a type.

The following is the code I wrote
Code: [Select]

#include<IRremote.h>

const int irReceiverPin = 2;

IRrecv irrecv(ivReceiverPin);
decode_results results;
void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn();
}
void loop()
{
  if (irrecv.decode(&results){
    Serial.print("ircode");
    Serial.print(results.value, HEX);
    Serial.println(results.bits);
    irrecv.resume();
  }
}


The following is the message which came from arduino IDE
Code: [Select]

/Users/TommyHu/Downloads/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=103 -I/Users/TommyHu/Downloads/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino -I/Users/TommyHu/Downloads/Arduino.app/Contents/Resources/Java/hardware/arduino/variants/standard /var/folders/40/qp_yf07j11z_nb9qwcs2fgd40000gn/T/build6216189189652123984.tmp/sketch_mar03a.cpp -o /var/folders/40/qp_yf07j11z_nb9qwcs2fgd40000gn/T/build6216189189652123984.tmp/sketch_mar03a.cpp.o
sketch_mar03a.ino:2:21: warning: IRremote.h: No such file or directory
sketch_mar03a.ino:2:21: warning: IRremote.h: No such file or directory
sketch_mar03a:6: error: 'IRrecv' does not name a type
sketch_mar03a:6: error: 'IRrecv' does not name a type
sketch_mar03a:7: error: 'decode_results' does not name a type
sketch_mar03a:7: error: 'decode_results' does not name a type
sketch_mar03a.ino: In function 'void setup()':
sketch_mar03a:11: error: 'irrecv' was not declared in this scope
sketch_mar03a.ino: In function 'void setup()':
sketch_mar03a:11: error: 'irrecv' was not declared in this scope
sketch_mar03a.ino: In function 'void loop()':
sketch_mar03a.ino: In function 'void loop()':
sketch_mar03a:15: error: 'irrecv' was not declared in this scope
sketch_mar03a:15: error: 'irrecv' was not declared in this scope
sketch_mar03a:15: error: 'results' was not declared in this scope
sketch_mar03a:15: error: 'results' was not declared in this scope
sketch_mar03a:15: error: expected `)' before '{' token
sketch_mar03a:15: error: expected `)' before '{' token
sketch_mar03a:21: error: expected primary-expression before '}' token
sketch_mar03a:21: error: expected primary-expression before '}' token
sketch_mar03a:21: error: expected `;' before '}' token
sketch_mar03a:21: error: expected `;' before '}' token


My OS: mac os x 10.8.2
Arduino IDE edition: 1.0.3
Arduino board type: UNO

MaJiG

The path "/Users/username/Documents/Arduino/libraries" looks like a Windows path.  Does your Mac use the same file structure?

tomyhu1995

Hi,

Thanks for your reply.

I copied the route from my arduino IDE.

The photo is what showed on my IDE.

please teach which route is the right one to install folder like IRreomte.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy