I am trying to create a simple sketch to switch things using an IR remote. It works, but I have to press a button several times to get a response and I think this has to do with the HEX code sent out by the remote. (found that with a IR reader)
The code sent shows: FD9A65 FFFFFF FFFFFF FFFFFF etc.
The sketch is meant for an ATTiny85, and like mentioned, it works, but not satisfactory. I think that is caused by the “overwhelming” amount of FFFFFF’s that follow the intended HEX.
So, how do I filter out/ignore those FFFFFF’s in the sketch? Or add something to the sketch to make it recognize the active HEX PLUS one or two FFFFFF’s
(A second question that has come up; why is there no list of commands that one can use, or something like that in the library?)
int RECV_PIN = 2;
#define code0 0xFD9A65 //Button Power/Standby
#define code1 0xFD1AE5 //Button Subtitle
#define code2 0xFD18E7 //Button Language
#define code3 0xFD9867 //Button Open/Close
#define code4 0xFDB24D //Button Angle
int x = (results.value);
irrecv.resume(); // Receive the next value
Program uses 76% of memory of the ATTiny. Settings for loading the sketch were:
Clock 8 Mhz internal, BOD disabled, Arduino as SPI.