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??
Thanks for your help!!