Anybody know anything about Arduino programming & IR control able to help me ?

GroupDIY Audio Forum

Help Support GroupDIY Audio Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

Rob Flinn

Well-known member
Joined
Jun 3, 2004
Messages
5,244
Location
Between Sussex, UK & Aude, France.
Hello,

I'm currently building a non audio related project that uses an Arduino UNO to control a stepper motor & sync a DLSR to stck macro photographs.

The project uses an IR remote to control the functions on the Arduino.  I'm having issues getting full functionality out of the remote.

The part of the code forthe remote mapping is below.  I'm using a generic control set to Sony Bravia.  However it doesn't hve the fast forward rewind buttons.  I'm trying to map some of the other unused buttons.        I can run another bit of code that displays the numbers squirted out by the reote in decimal format.  However if I substitute them into the code below I get no response on those buttons.    Also the numeric keys get the Arduino respnding, but the numbers that the remote puts out are different to the defined numbers in the code below.  For example see the remote map below.  The defined number for key one is 16 & when I decode the remote the number being squirted out is 544993039.    Can anyone explain this ?  I've looked on teh Arduino forum etc, but I'm finding this quite confusing.

// Sony Bravia KDL-55HX850 TV Protocol, will work for many different Sony TV remotes
// This is in the Harmony DB, so you can emulate this remote with a Logitech Harmony device
#define REMOTE_MINBITS 12 // the number of bits that must be received before a code can be considered received
#define REMOTE_MAXBITS 15 // the number of bits received after which a code must be considered received
#define REMOTE_HIGHMAX 2700UL // elapsed time (in microseconds) since last down-sloping IR signal edge above which the code reading will reset
#define REMOTE_HIGHMIN 1600UL // elapsed time (in microseconds) since last down-sloping IR signal edge that acts as a theshhold between a 0 and 1 bit
#define REMOTE_INTERRUPT_ON RISING
#define BT_1 16 // 1
#define BT_2 2064 // 2
#define BT_3 1040 // 3
#define BT_4 3088 // 4
#define BT_5 528 // 5
#define BT_6 2576 // 6
#define BT_7 1552 // 7
#define BT_8 3600 // 8
#define BT_9 272 // 9
#define BT_0 2320 // 0
#define BT_ENTER 2672 // Enter
#define BT_REWIND 27881 // Rewind (15 bits)
#define BT_FASTFORWARD 7401 // Fast Forward (15 bits)
#define BT_UP 752 // Up
#define BT_DOWN 2800 // Down
#define BT_LEFT 720 // Left
#define BT_RIGHT 3280 // Right
#define BT_STOP 3305 // Stop (15 bits)
#define BT_START 11497 // Play (15 bits)
#define BT_MENU 112 // MENU
#define BT_HALFPRESS 2192 // Channel down
#define BT_FULLPRESS 144 // Channel up
#define BT_BACKLIGHT 3024981499 // Volume up

Remote control map
STANDBY 4045713590
1 544993039
2 3896860046
3 3417827657
4 740241778
5 2422134005
6 2363614204
7 828053765
8 3330015670
9 3021527401
0 990610224
VOL UP 3024981499
VOL DOWN 1133087936
BACK
MUTE 2029287847
CH UP 3157860949
CH DOWN 4289706204
MENU 986196487
GUIDE
16:09 1550612371
UP 2329149500
DOWN 3972638542
LEFT 1779511133
RIGHT 185430893
OK 1922410756
FAV
INFO 3697861695
EXIT 638623578
RED 1779511133
GREEN 2329149500
YELLOW 185430893
BLUE 3972638542
 
The first thing I'd confirm is that the processor's clock frequency is set to the value expected by the code.

Also, it helps to look at the output of the IR receiver on an oscilloscope, to verify that the remote is sending pulses in the format you expect.
 
Back
Top