IR Receiver and Servo help required

Hi guys,

Hoping someone can help with this as what I thought would be a simple project is giving me headaches. So I have a basic set up with an IR receiver and a servo. So I check for the code from the Sony remote and then move the servo. There's a little more there as I attach and detach the servo to try and get around some servo jitter but that's it.

This all works fine in isolation but I using it to switch on a camera. But the camera is near other devices that work from IR remotes. When one of these remotes is used it stops my set up from working. I've check the protocol of this remote and it's an UNKNOWN one which seems to send out a couple of different codes at a time.

Is this purely the Arduino can't manage the multiple unknown codes being sent through or should I be able to safeguard against this in my code?

I've attached what I have which is created based on templates so probably not very pretty.

Any help would be great.

Many thanks Duncan

I've attached what I have

Where?

Hi,

Sorry it’s hopefully attached now. Not sure what happened there but clearly didn’t attach the first time.

Many thanks

servo_sony_v2.ino (1.63 KB)

Hi again,

Just to mention, it's almost as if the codes coming through can't be managed and so it all stops. The only way to get the Sony button working again is to power off the Arduino and power on again to reset it.

Thanks Duncan

myReceiver.enableIRIn();

Why are you calling enableIRIn() again? Did you look at any of the examples that came with the IR library? Do ANY of them call enableIRIn() more than once? What DO the examples use after a value has been received?

Hi guys,

I've managed to sort this out. Using an example from the library and outputing to serial monitor I could see that the other remote was sending a code that then continuously flooded through. I got around this by adding irrecv.resume(); after the (irrecv.decode(&results)). Bit of a workaround but it interrupts the 'flooding' and allows me to send further IR requests.

Nothing further needed.