IR remote receiver programming problem.

I have written a sketch for a digital clock that I have desgned using Arduino Uno. It incorporates a DS1302 clock chip, a I2C 7 segment 4 digit displa for the time and I2C 20 x4 LDC display for messages such as Date, Day of Week etc. The sketch runs OK for days on end powered with a 9V power supply.
Now I want to add to this to incorporate an IR remote receiver to capture remote signals in order to be able to change the clock settings whilst the sketch is running. HOWEVER I have run into a problem, when I try to include the IR remote library the sketch compiles but will not run. Here are the 'includes' at the heading of my Sketch :-
#include <DS1302.h>
#include <LiquidCrystal.h>
#include <Wire.h>
#include "Adafruit_LEDBackpack.h"
#include "Adafruit_GFX.h"
#include <LiquidCrystal_I2C.h>
#include <IRremote.h>

As it stands the Sketch will not run but if I comment out the #include <IRremote.h> it runs OK.
Can anyone suggest a reson and a possible cure ??

Memory maybe?

the Sketch will not run

How do you know it's not running though: maybe it's running and not displaying anything. Debug prints would verify if the program was actually running.

I do know that IRremote messes with pin 3: iirc, it prevents PWM on that pin. I'm not sure if that's the only thing it screws with. Is anything on pin 3 which might be causing your symptom of not running?

I'm not sure if that's the only thing it screws with. Is anything on pin 3 which might be causing your symptom of not running?

It "messes" with PWM on that pin by stealing the timer that PWM on that pin needs. If there is anything else in you code that needs that timer, you won't be able to use the IR library.

Without seeing anything more than that useless snippet of code, we'd just be guessing as to your real problem.

Jimbo and Paul many thanks for replies. The DS1302 RTC clock uses pins 2,3 and 4 so from what you both say it looks like the IR remote code is interfering with the clock operation. If there is no way around this it would seem that I am not going to be able to do what I had planned and will have to find some other way.

owddabbler86:
The DS1302 RTC clock uses pins 2,3 and 4

But isn't that becasue you set the pins with a line like this:

DS1302 rtc(2, 3, 4);

So presumably you can move the 1302?

Thanks Jimbo for quick reply. You are probably correct about moving the DS1302 pins to other pins than 2,3 and 4. I will look into that tomorrow. I will possibly try 5,6 and 7. and post my findings later.

I will possibly try 5,6 and 7. and post my findings later.

I'd recommend that you not use any PWM pins.

Paul - Why not use any PWM pins ? I have already been using pins 2,3 and 4 successfully and Pin 3 is a PWM pin. ???

Paul - Why not use any PWM pins ? I have already been using pins 2,3 and 4 successfully and Pin 3 is a PWM pin.

So, explain to me again why you are here. Not that it's a problem, mind you. I'm just trying to understand why you posted that everything is fine.