Software: Finding the values for the remote buttons

I’m referencing this site. I’m starting with this sketch as it gives me values for any IR remote buttons. The only thing that needs to be tweaked is whatever pin # you’re using. When I look at the serial monitor, I see a value pop up each time I hit a button on the remote. I’m picking two buttons that I don’t really use for anything else (just so happens to be a plain yellow button and a plain red button) – and the values I get are 7B8 (yellow button) and 78B (red button).

 

/*
* IRremote: IRrecvDemo – demonstrates receiving IR codes with IRrecv
* An IR detector/demodulator must be connected to the input RECV_PIN.
* Version 0.1 July, 2009
* Copyright 2009 Ken Shirriff
* http://arcfn.com
*/
#include <IRremote.h>
int RECV_PIN = 3; // set to the pin number that you’re using
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
}
void loop() {
if (irrecv.decode(&results)) {
Serial.println(results.value, HEX);
irrecv.resume(); // Receive the next value
}
}

Advertisements
Post a comment or leave a trackback: Trackback URL.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: