2. The IR pin is determined by the IRRemote library and the pin differs for different boards. On the Arduino Uno it's pin 3. Here's the source for the library: https://github.com/z3t0/Arduino-IRremote
. The pins for other boards I believe are defined in the irremote.h file.
I'm slow, but persistent. Your statement above is correct (of course). From what I see in the default library, the Mega1280/2560 boards use Pin 9 instead of the Pin 3 for the Uno boards. @AnotherHobby
in his iAqua Lite had changed the IRRemote library file IRremoteInt.h to use Pin 46. It's a matter of commenting out Pin 9 and un-commenting Pin 46.
Also FYI, it appears you are using a slightly newer version of the library. It took me a while to figure this out because all the headers indicate "Version 0.1 July, 2009", so I incorrectly presumed you both were using the identical library. When I did a diff, it became apparent it was two different versions. I doubt it matters at all for our purposes, but I suspect the main difference is "Whynter A/C ARC-110WD added by Francesco Meschia" (the last line in the header of each library file).
Anyway, if I had a regular IR LED, I would use your code and just use Pin 9. But since I don't, I'll complicate my life. I'll just note the changes below, in case anyone else comes down this path (and remind myself later):
In IRRemote.ino, add the following:
// Define power pins for the IR module
#define IR_TRANS_5V_PIN 44 // Power to IR transmitter
#define IR_TRANS_GND_PIN 42 // GND for IR transmitter
// Add this to the "Setup code" section
// Activate IR emmitter
In the library file IRremoteInt.h comment out using Pin 9 and use Pin 46:
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
//#define IR_USE_TIMER1 // tx = pin 11
//define IR_USE_TIMER2 // tx = pin 9
//#define IR_USE_TIMER3 // tx = pin 5
//#define IR_USE_TIMER4 // tx = pin 6
#define IR_USE_TIMER5 // tx = pin 46
So, I have successfully managed to get this code controlling my Sat+Pro.
Now, I'm just trying to figure out the memory schedule page and how to sync the current color values with what is actually going on. I expected that when it sent the command for M1 (or whatever), it would reset the current color values to that setting, since you have a page that defines those values. But, that's clearly not what happens.
I'm making progress. I'm sure all this would be much simpler for someone used to coding and familiar with Arduino's in general. My learning curve has been fairly steep with all this. I am enjoying learning it, but hope you don't mind me cluttering up your thread.
And Harry, you mentioned you were running tight on space on the Uno board. Here's something to consider!
Sketch uses 30,290 bytes (11%) of program storage space. Maximum is 253,952 bytes.
Global variables use 1,477 bytes (18%) of dynamic memory, leaving 6,715 bytes for local variables. Maximum is 8,192 bytes.