IRsend does not name a type

I’m trying to make an infrared beam between an IR LED and IR Receiver (TSOP382) and detect when the beam is blocked. I’m getting the “IRsend does not name a type” error when I try to compile this code to test it out.

The full error:

Arduino: 1.0.6 (Mac OS X), Board: “Arduino Uno”
IR2:10: error: ‘IRsend’ does not name a type
IR2.ino: In function ‘void setup()’:
IR2:15: error: ‘irsend’ was not declared in this scope

I installed the Ken Sheriff IR library (https://github.com/shirriff/Arduino-IRremote) and have tried renaming the folder to have an underscore instead of a hyphen. I used the Add Library function in the Arduino IDE.

When researching this error it seems to be commonly suggested to delete the RobotIRemote library. I would love to but it is not in my library folder. I searched my hard drive for RobotIRemote and there isn’t any file. The Arduino library folder on my hard drive only shows libraries I’ve downloaded, although the Arduino coding environment has the RobotIRemote and others available in the Sketch > Import Library menu.

My computer detects the Uno as a “modem” so I’m not able to look at anything on the actual Arduino or delete anything there.

I have gotten all the ardx.org beginner projects to work; it’s just been as soon as I needed this IR library that I’ve had this problem.

Thank you so much for any help.

#include <IRremote.h>
#include <IRremoteInt.h>


#define PIN_IR 3
#define PIN_DETECT 2
#define PIN_STATUS 13

IRsend irsend;
void setup()
{
  pinMode(PIN_DETECT, INPUT);
  pinMode(PIN_STATUS, OUTPUT);
  irsend.enableIROut(38);
  irsend.mark(0);
}

void loop() {
  digitalWrite(PIN_STATUS, !digitalRead(PIN_DETECT));
}

hrothgar:
I installed the Ken Sheriff IR library (GitHub - Arduino-IRremote/Arduino-IRremote: Infrared remote library for Arduino: send and receive infrared signals with multiple protocols) and have tried renaming the folder to have an underscore instead of a hyphen. I used the Add Library function in the Arduino IDE.

I think the library directory should be called IRremote, not Arduino_IRremote. Re-start the IDE after you change the name and see if that helps.

John, thank you for the suggestion. I tried renaming it and restarting the IDE, but unfortunately no luck.

Which folder do you have the library files in ?

HeliBob, they are in \Arduino\libraries\Iremote

The sketches are also in this Arduino folder. It is the only arduino folder on the hard drive.

they are in \Arduino\libraries\Iremote

The normal place to install extra libraries is in the libraries folder of your sketches folder and the name of the folder must match exactly the name of the .h and .cpp files.

If your sketches folder is \Arduino as you say then that itself is strange but workable. What is not right is the library folder name. Iremote != IRremote

Thank you for pointing out my typo, HeliBob. One letter can make or break. I did double check and it was correct on my computer.

Someone else was able to compile the code with a previous version of the IDE, and when I downloaded 1.5.4 it worked with no issue.

ola eu conseguir resolver o meu problema que era o mesmo que do Hrothgar tive que remover a pasta do RobotIRremote , pois ela estava em conflito com a outra IRremote depois disso compilei e deu certo

hello I can solve my problem it was the same as the Hrothgar had to remove the folder RobotIRremote because it was in conflict with the other irRemote thereafter compiled and worked

by:eron