IR Sensor Help Please

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
sinjinmanta
 
Posts: 41
Joined: Sat Jun 14, 2014 4:09 pm

IR Sensor Help Please

Post by sinjinmanta »

Hello, I'm trying to follow the tutorial found on https://learn.adafruit.com/ir-sensor/re ... r-commands and the code at https://github.com/adafruit/IR-Commander but I am having some difficulty.

I have the sensor and Arduino hooked up properly and can receive button presses from a remote control. I have taken that string of numbers and placed it into the array found in ircodes.h , replacing the first ApplePlaySignal information. I do not have an IR LED for transmitting, and that is okay because all I want it to do is to receive the signal, compare the signal received to the stored array, and then print on the serial monitor the name of the button that was pressed. Instead of spitting out "Play", the serial monitor just reads:

Ready to decode IR!
Heard 58-pulse long IR signal
count set to: 58
count set to: 36
count set to: 58

Does anyone have any suggestions? Thank you!


Here is my ircodes.h file for the first button:

int ApplePlaySignal[] = {
// ON, OFF (in 10's of microseconds)
8680, 4300,
660, 500,
580, 540,
580, 540,
580, 540,
580, 540,
600, 520,
600, 520,
600, 560,
580, 540,
580, 540,
580, 540,
580, 540,
580, 540,
600, 520,
600, 520,
600, 560,
580, 540,
580, 540,
580, 540,
580, 540,
580, 540,
600, 520,
600, 520,
600, 560,
580, 540,
580, 1600,
580, 1600,
580, 1580,
600, 540,
580, 540,
580, 540,
580, 560,
580, 540,
580, 1600,
580, 540,
580, 540,
600, 520,
600, 1580,
600, 540,
580, 560,
580, 1600,
580, 1600,
580, 1580,
600, 540,
580, 1600,
580, 1600,
580, 540,
580, 1600,
600, 1580,
600, 520,
600, 1580,
600, 1580,
600, 520,
600, 520,
600, 520,
600, 520,
600, 0};

User avatar
Franklin97355
 
Posts: 23910
Joined: Mon Apr 21, 2008 2:33 pm

Re: IR Sensor Help Please

Post by Franklin97355 »

Are you sure of your figures? The numbers in the ircodes.h file are 1/10 the size of yours.

User avatar
sinjinmanta
 
Posts: 41
Joined: Sat Jun 14, 2014 4:09 pm

Re: IR Sensor Help Please

Post by sinjinmanta »

I didn't augment the numbers in any way. I pulled them straight from the serial output of the rawirdeconstruct.ino sketch. I'm at a loss.

User avatar
sinjinmanta
 
Posts: 41
Joined: Sat Jun 14, 2014 4:09 pm

Re: IR Sensor Help Please

Post by sinjinmanta »

UGH! I scrounged up an Apple remote to compare the values, and sure enough, they are at a factor of 10x coming out of the rawirdeconstruct.ino sketch. Apparently the Adafruit ircommander code does use usecs in 10s. Wow, thank you! I now have a functional receiver!!!

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”