Libraries incompatible: IRemote.cpp vs. NewPing.cpp

This will modify the IRRemote library to use a different timer.

Not sure how good your knowledge of the Dutch language is :wink: IRremote.h library werkt niet meer? gives a description in Dutch how to approach the problem; I'm sure I have also written a post in English, but could not quickly find it.

[edit]
Ah, here is a description of the approach in English.
[/edit]

In short, find the below in IRremoteInt.h; it will be somewhere around line 220

// Arduino Duemilanove, Diecimila, LilyPad, Mini, Fio, Nano, etc
// ATmega48, ATmega88, ATmega168, ATmega328
#else
	//#define IR_USE_TIMER1   // tx = pin 9
	#define IR_USE_TIMER2     // tx = pin 3

#endif

Change it to

// Arduino Duemilanove, Diecimila, LilyPad, Mini, Fio, Nano, etc
// ATmega48, ATmega88, ATmega168, ATmega328
#else
	#define IR_USE_TIMER1     // tx = pin 9
	//#define IR_USE_TIMER2   // tx = pin 3

#endif

Add a comment with a motivation as to why you changed it.

Note:
This change will affect any code that you wrote in the past that uses IRremote; if you did not have an interrupt conflict in the past, you might now have one in the old code if it uses timer1 (e.g. in another library). Same for code that you write in the future where you use timer1.

That's why it's important to document the change.

The alternative is to copy the IRremote library to your sketch; either copy it directly to the sketch directory or create a src directory and copy it there and modify it. You will also need to change the 'includes'. The latter should work with newer IDEs (it did not work with 1.6.6 when I tried). The advantage is that the modification is local to your project and does not affect previous code or future code.