downloaded library not working

This is my first time downloading and unzipping a library for Arduino. Im trying to use the IRremote.h library so i followed the instructions for using a downloaded library. sketch>add file> name it libraries. Then place the unzipped IRremote.h file in the file named libraries. Then it says upload the corresponding program to arduino and it should work:

#include <IRremote.h>
IRsend irsend;

void setup()
{
Serial.begin(9600);
}

void loop() {
if (Serial.read() != -1) {
for (int i = 0; i < 3; i++) {
irsend.sendSony(0xa90, 12); // Sony TV power code
delay(100);
}
}
}

Now Im assuming irsend.sendSony(0xa90, 12);" sends the sony frequency out of the emitter correct??

I am using the camera on my phone to determine if a signal is being sent and its not.

I can use the tone(pin,38000, 20) command a see the emitter sending out a signal though. So I dont know whats going on.

Also, why cant I find just a simple code or example program to send out signals with the emitter and when the receiver sees a signal it runs a program. I DONT NEED TO USE ARDUINO AS A REMOTE CONTROL. I need it to detect a signal and do something completely different.

Basically, all I want to do is run different frequencies out of the emitter starting at say 34000ish and go to 38000ish in intervals of 100 hz. ie 30000, 30100, 30200 .... 38000. Before I run the program I set an object at a fixed distance from the emitter. Once the program is running and the receiver is triggered, I can determine that frequency corresponds to the preset fixed distance. I repeat this at multiple distances to figure out my which frequency range corresponds to each distance. Now I have a distance detector. Ive done this on a parallax board before, but now I need to do it with Arduino.

Please HELP!!!

with both delimmas if possible. Importing a library and using an IR sensor.

Oh, while Im at it, heres another one for you.

Ive seen two different wiring configurations for the IR receiver.

Basically: (with detector facing me)
1 (far right) = input (read pin) some call it output
2 (middle) = Vs (5v)
3 (far left) = ground
this setup worked for me with basic stamp but I dont know what receiver I was using. (It came with the class)

but I found a long tutorial at:

and it says:

1 (far right) = Vs (5v)
2 (middle) = ground
3 (far left) = input (pin read)

Also, there are a ton of comments saying the library is great and Im assuming they are also using his (sheriff ken) wiring diagram. Sheriff Ken says this works with a Radio Shack 276-640 IR receiver and that is what I am now using for this project. Which wiring diagram is correct?

A lot of questions, huh?? :slight_smile:

Thanks for your help!!

Also, YES, :frowning: I am only a beginner, please dont laugh to hard at my questions??
;D

Im trying to use the IRremote.h library so i followed the instructions for using a downloaded library.

Which instructions? The steps you outlined do not look like anything I've seen before.

Also, why cant I find just a simple code or example program to send out signals with the emitter and when the receiver sees a signal it runs a program. I DONT NEED TO USE ARDUINO AS A REMOTE CONTROL. I need it to detect a signal and do something completely different.

Please stop shouting. Perhaps you can't find a simple program to do what you want because one doesn't exist. That shouldn't cause you to shout, though. Just get busy writing one.

If you don't want the Arduino to act like a remote control that can send IR signals, don't program it to do that.

If you know how to use the tone command to send IR signals, what do you need the IR library for?

Oh, while Im at it, heres another one for you.
Ive seen two different wiring configurations for the IR receiver.
Sheriff Ken says this works with a Radio Shack 276-640 IR receiver and that is what I am now using for this project. Which wiring diagram is correct?

Different wiring diagrams are for different IR receivers. The one that is correct is the one that corresponds to the IR receiver you have.

I wasnt shouting, I was adding sarcasitic emotion. I understand that I dont use a program if I dont need it, but I am taken back that there are examples out there for remote controls, but not a simple program to just emit and receive. Does that make sense? Its like the Adruino reference site and all the forums skipped over the IR beginner stuff and went straight to level 5. So, I started with the tone command just to play around and see if I could get anything. It would be nice to atleast have a beginner tutorial for the IR emit and receive and I am wondering if anyone knows of one out there. I am trying to use the IRremote.h library just because its a platform to get started from. Once I get a program using that going then I can write a program to do what I actually want, you know?

About the libraries, yes I am a bit lost!! I have had my mac for less then six months and Im still getting used to it. The sketch>add file> name it libraries was my best guess to what Ken Shirriff said in "arduino/hardware/libraries". I know Im doing it wrong and thats why Im here. Please help.

Im also kinda of lost on what the arduino reference says about libraries:
http://www.arduino.cc/playground/Interfacing/Processing

Instructions

  1. Unzip the library and copy the "arduino" folder into the "libraries" sub-folder of your Processing Sketchbook. (You can find the location of your Sketchbook by opening the Processing Preferences. If you haven't made a "libraries" sub-folder, create one.)

This says create a sub-folder called "libraries" but where do I put it? I say this because when I open up preferences on Arduino it says my location is

/Users/&*%^$#^/Documents/Arduino

So does that mean I create the libraries file at

/Users/&^%#^/Documents/Arduino/libraries

Then I place the Arduino program in that location again

/Users/(*&^%$#/Documents/Arduino/libraries/Arduino

This seems to be going in circles. I dont get it! (I wont capitalize this time cause Im not mad, but Im be sarcastic with a little bit of frustration)

I've never had the pleasure/misfortune of installing libraries on a Mac, so I can't help you there.

You are trying to follow the instructions for installing a Processing library to install an Arduino library. No doubt that won't work.

We'll need to wait for a Mac user to provide definite instructions, or you could search the forum. The issue has been discussed many times. As I don't own a Mac, I've never paid attention.

Using an IR transmitter and IR receiver is pretty easy. The hard part is making the Arduino send data that a specific device can read and understand. That's what the IR library makes simple.