Whandall:
Sounds like a truncation caused by using (u)int16_t instead of a proper uint32_t.
I guess the variable used for the switch (hasTheWrongType) {, but without code, who knows?
You have probably right. I try use another remote (SONY protocol) just like how DrDiettrich advised, but most of button have "duplicate case value". So i guess the code doesn't take all of the remote code into account, but onlu a part.
Here is my code (some, in my opinion, not important parts had to be removed, they did not fit in post):
#include <IRremote.h>
int RECV_PIN = 7;
int button = 2;
int power = 3; //itOn[1]
int volup = 4;
int voldown = 5;
int mute = 6; //itOn[2]
int led2 = 0;
int tt_play = 8;
int tt_cuton = 9;
int tt_cutoff = 10;
int tt_motor = 11;
int bt_play = 12;
int bt_next = 14; //A0
int bt_back = 15; //A1
int statusLed = 13;
int timerSetA = 16; //A2, timer 15min -|
int timerSetB = 17; //A3, timer 30min |- 60 min
int timerSetC = 18; //A4, timer 45min -|
int timerReset = 19; //A5, reset timer after change
int timer = 0;
int itsON[] = {0, 0, 0, 0, 0};
boolean TT_status = 0;
int oldButtonState = LOW;
int localon_off = LOW;
#define code1 16744575 // code power
#define code2 16736415 // code vol+
#define code3 16769055 // code vol-
#define code4 16732335 // code mute
#define code5 16730295 // code timer+
#define code6 16742535 // code timer-
#define code7 16752735 // code led
#define code8 16726215 // code tt play
#define code9 16724175 // code tt cut on
#define code10 16775175 // code tt cut off
#define code11 16728255 // code bt play
#define code12 16758855 // code bt next
#define code13 16771095 // code bt back
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
Serial.begin(9600);
irrecv.enableIRIn();
pinMode(button, INPUT);
pinMode(power, OUTPUT);
pinMode(volup, OUTPUT);
pinMode(voldown, OUTPUT);
pinMode(mute, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(tt_play, OUTPUT);
pinMode(tt_cuton, OUTPUT);
pinMode(tt_cutoff, OUTPUT);
pinMode(statusLed, OUTPUT);
pinMode(bt_play, OUTPUT);
pinMode(bt_next, OUTPUT);
pinMode(bt_back, OUTPUT);
pinMode(tt_motor, INPUT);
pinMode(timerSetA, OUTPUT);
pinMode(timerSetB, OUTPUT);
pinMode(timerSetC, OUTPUT);
pinMode(timerReset, OUTPUT);
}
void loop() {
//status gramofon
TT_status = digitalRead(tt_motor);
if (irrecv.decode(&results)) {
unsigned int value = results.value;
switch(value) {
//remote command:
//system on/off
case code1:
break;
//volume up
case code2:
break;
//volume down
case code3:
break;
//mute
case code4:
break;
//timer +
case code5:
break;
//timer -
case code6:
break;
//led
case code7:
break;
//TT_play
case code8:
break;
//TT_cutOn
case code9:
break;
//TT_cutOff
case code10:
break;
//BT_play
case code11:
break;
//BT_next
case code12:
break;
//BT_back
case code13:
break;
}
irrecv.resume();
}
}