IRRemote help Arduino nano

I am having an issue with my gesture sensor remote control for my Samsung TV and was hoping I could find help on this forum. (for full details see How to Make a Gesture Remote Control with Arduino)

I am using an arduino nano, apds-9960 and the IRRemote library.

You shouldn’t have to worry about the apds as that is working.

Everything is working except the sending of signals from my IR LED. I have tried sendRAW and sendSAMSUNG. I wired up a second arduino with a receiver to print out what was being sent from the IR transmitter and there was a constant overflow of codes and protocols that continued on forever.

I have tried:
Sending a signal 3 times with a delay of 40, 70 and 100
Inputting different RAW codes (the power button has multiple different RAW codes for some reason)

I hope someone can help me as I really want to get this project finished.

My current code is attached.

Thank you in advance.

mlloyd

Gesture_Remote.ino (6.2 KB)

the power button has multiple different RAW codes for some reason

Typically, because the power button is meant to turn the TV on, the cable box on, the DVD player on, etc. Each device only responds to one code. The transmitter sends several, to turn everything on.

You have WAY too much code for an Arduino that does not appear to be sending the right data, or sending it properly, for one single function.

Shit-can all that sleep crap. Forget the gesture sensing crap.

Variables shared between the ISR and other functions, such as isr_flag, MUST be declared volatile. Otherwise, loop() knows that isr_flag has not changed, and will do nothing.

PaulS:
Forget the gesture sensing crap.

I do appreciate your help with the amount of code etc. I binned the sleep stuff. But telling me to forget the main reason I am doing this project in the first place does not help.

mlloyd007:
I do appreciate your help with the amount of code etc. I binned the sleep stuff. But telling me to forget the main reason I am doing this project in the first place does not help.

I think they meant "Get your IRremote code working in a separate sketch before integrating it into your larger sketch. That way you can tell if the problem is in the IRremote code or the integration." :slight_smile: