Your Universal Remote Control Center
RemoteCentral.com
Everything Else Forum - View Post
Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Original thread:
Post 1 made on Sunday December 18, 2016 at 22:54
mrage87
Lurking Member
Joined:
Posts:
November 2016
3
Hi guys

I'm trying to build a simple remote on an arduino uno using raw codes and the iremote library for my brother who has cerebral palsy.
Basically what happens is you push a button and it sends 4 button presses (3 digit channel number and ok/enter) from a list of pre programmed channels he likes.

The weird issue I'm having is that even though I've copied the codes for the xr2 remote and they work perfectly on my box they do not work on the box on his tv.
The codes original came from this site and also [Link: irdb.tk]. I had to convert the hex to raw format.

I believe his box is a PA PX001ANM and mine is a PA PR150BNM according to the xfinity website

I have the ir led literally an inch away in both tests but his box seems to only receive one or two of the button presses randomly.
I have no idea why his box would have such a huge issue. I would assume that since I'm repeating codes from a remote that works on both boxes there shouldn't be any compatibility issues.
Hopefully someone here has an idea because this is all way over my head at this point


Here is everything I have currently. I only have basic programming skills and this is the first time doing anything involving circuitry so please forgive me if there is a glaring issue somewhere.

My arduino setup is basicly 3 PWM -> 100 ohm resistor -> 38 khz ir led -> Ground

Codes copied from here and irdb that work on my box
unsigned int btn1[36] = {210, 896, 210, 1712, 210, 760, 210, 2800, 210, 1304, 210, 1304, 210, 1168, 210, 2664, 210, 13800, 210, 896, 210, 2664, 210, 760, 210, 760, 210, 760, 210, 896, 210, 760, 210, 760, 210, 80400};
unsigned int btn2[36] = {210, 896, 210, 1712, 210, 760, 210, 2800, 210, 1304, 210, 1304, 210, 1168, 210, 2664, 210, 13800, 210, 896, 210, 2528, 210, 760, 210, 760, 210, 760, 210, 1032, 210, 760, 210, 760, 210, 80400};
unsigned int btn3[36] = {210, 896, 210, 1712, 210, 760, 210, 2800, 210, 1304, 210, 1304, 210, 1168, 210, 2664, 210, 13800, 210, 896, 210, 2392, 210, 760, 210, 760, 210, 760, 210, 1168, 210, 760, 210, 760, 210, 80400};
unsigned int btn4[36] = {210, 896, 210, 1712, 210, 760, 210, 2800, 210, 1304, 210, 1304, 210, 1168, 210, 2664, 210, 13800, 210, 896, 210, 2256, 210, 760, 210, 760, 210, 760, 210, 1304, 210, 760, 210, 760, 210, 80400};
unsigned int btn5[36] = {210, 896, 210, 1712, 210, 760, 210, 2800, 210, 1304, 210, 1304, 210, 1168, 210, 2664, 210, 13800, 210, 896, 210, 2120, 210, 760, 210, 760, 210, 760, 210, 1440, 210, 760, 210, 760, 210, 80400};
unsigned int btn6[36] = {210, 896, 210, 1712, 210, 760, 210, 2800, 210, 1304, 210, 1304, 210, 1168, 210, 2664, 210, 13800, 210, 896, 210, 1984, 210, 760, 210, 760, 210, 760, 210, 1576, 210, 760, 210, 760, 210, 80400};
unsigned int btn7[36] = {210, 896, 210, 1712, 210, 760, 210, 2800, 210, 1304, 210, 1304, 210, 1168, 210, 2664, 210, 13800, 210, 896, 210, 1848, 210, 760, 210, 760, 210, 760, 210, 1712, 210, 760, 210, 760, 210, 80400};
unsigned int btn8[36] = {210, 896, 210, 1712, 210, 760, 210, 2800, 210, 1304, 210, 1304, 210, 1168, 210, 2664, 210, 13800, 210, 896, 210, 1712, 210, 760, 210, 760, 210, 760, 210, 1848, 210, 760, 210, 760, 210, 80400};
unsigned int btn9[36] = {210, 896, 210, 1712, 210, 760, 210, 2800, 210, 1304, 210, 1304, 210, 1168, 210, 2664, 210, 13800, 210, 896, 210, 1576, 210, 760, 210, 760, 210, 760, 210, 1984, 210, 760, 210, 760, 210, 80400};
unsigned int btn0[36] = {210, 896, 210, 1712, 210, 760, 210, 2800, 210, 1304, 210, 1304, 210, 1168, 210, 2664, 210, 13800, 210, 896, 210, 2664, 210, 760, 210, 760, 210, 760, 210, 896, 210, 760, 210, 760, 210, 80400}; // not actual code - test
unsigned int btnEnter[36] = {210, 896, 210, 1712, 210, 760, 210, 2800, 210, 1304, 210, 1304, 210, 1168, 210, 2664, 210, 13800, 210, 896, 210, 1848, 210, 760, 210, 760, 210, 1032, 210, 1440, 210, 760, 210, 760, 210, 80400};


Codes I pulled directly from my xr2 remote with analisysir. For some reason the codes seem repeated but I tested them anyway and they also work
unsigned int btn1[] = {220,896,228,1692,228,736,224,2788,228,1280,224,1280,228,1148,228,2656,224,13776,220,896,224,2660,224,736,224,736,224,740,220,896,228,732,228,732,228,80334,220,896,224,1700,224,736,224,2788,224,1284,224,1280,224,1152,224,2660,224,13776,228,888,224,1568,224,1828,224,740,220,740,220,896,228,732,228,736,224};
unsigned int btn2[] = {220,896,228,1692,228,732,228,2788,224,1280,228,1280,228,1148,228,2656,224,13776,220,896,224,2504,228,732,228,732,228,732,228,1020,224,740,224,736,224,80334,224,892,232,1692,228,732,228,2784,232,1276,228,1280,228,1148,228,2652,228,13772,224,896,228,1432,224,1828,224,736,224,740,224,1020,224,740,220,740,220};
unsigned int btn3[] = {220,900,224,1696,224,736,224,2792,224,1280,224,1284,224,1152,224,2660,220,13780,228,888,224,2372,228,732,228,736,224,736,224,1152,224,736,224,736,224,80338,228,888,224,1700,220,740,220,2792,224,1284,220,1284,224,1156,220,2660,232,13768,228,888,224,1284,224,1828,224,736,224,736,224,1156,220,740,220,740,220};
unsigned int btn4[] = {228,888,224,1700,220,740,224,2788,224,1284,224,1284,220,1156,220,2664,220,13780,224,892,220,2248,220,740,220,740,220,740,224,1284,220,740,220,740,220,80342,224,892,228,1696,228,732,228,2784,228,1280,228,1276,232,1144,228,2656,228,13772,224,892,228,1148,228,1824,228,736,228,732,228,1280,224,736,228,732,228};
unsigned int btn5[] = {228,888,224,1700,220,740,224,2788,224,1284,284,1220,224,1152,224,2660,224,13776,280,836,224,2116,220,740,220,740,220,740,224,1440,276,684,228,732,228,80334,228,888,224,1700,220,740,224,2788,224,1284,224,1280,224,1156,220,2660,224,13776,228,888,224,1024,220,1832,220,740,224,740,220,1440,228,732,228,736,224};
unsigned int btn6[] = {224,892,228,1696,224,736,228,2788,224,1280,228,1280,228,1148,224,2660,224,13776,220,896,224,1956,228,732,228,736,228,732,228,1564,224,736,224,736,288,80290,224,892,228,1692,232,732,276,2736,280,1228,216,1288,220,1156,228,2656,228,13772,224,892,220,896,224,1828,228,736,224,736,224,1568,224,736,224,736,224};
unsigned int btn7[] = {228,888,224,1696,224,736,224,2792,224,1280,224,1284,224,1152,224,2660,220,13780,228,888,224,1828,224,736,224,736,224,740,224,1696,224,740,220,740,220,80354,220,896,228,1692,228,732,228,2788,228,1276,228,1280,228,1148,228,2656,224,13776,224,892,228,732,228,1824,228,732,232,732,228,1692,228,732,228,736,224};
unsigned int btn8[] = {228,888,224,1700,220,740,220,2792,224,1284,224,1280,224,1156,220,2660,224,13776,228,888,224,1700,220,740,224,736,224,740,220,1832,220,740,220,740,220,80342,220,896,228,1692,228,736,224,2788,228,1276,228,1280,228,1148,228,2656,224,13776,220,896,228,2784,228,1824,228,736,228,732,228,1824,228,732,228,732,228};
unsigned int btn9[] = {228,892,220,1700,224,736,224,2792,220,1284,224,1284,224,1152,220,2664,220,13780,224,892,220,1572,228,732,228,732,232,732,228,1952,220,740,232,732,228,80346,224,892,232,1692,228,732,228,2784,232,1276,228,1280,228,1148,228,2652,228,13772,224,896,228,2652,228,1824,228,736,276,684,232,1948,232,728,232,732,228};
unsigned int btn0[] = {228,888,224,1700,284,676,224,2788,284,1224,224,1280,224,1156,220,2660,232,13768,276,844,220,2792,220,740,224,736,224,736,224,740,220,740,220,740,232,80342,228,888,224,1700,224,736,224,2788,224,1284,224,1280,228,1152,220,2660,224,13776,228,888,224,1700,224,1828,224,736,224,736,224,740,220,740,224,736,224};

Here is the last build i was testing with

#include

//Pin settings
int PUSHBUTTON1 = 8;
int ledPin = 13;

// Raw commands for xr2 comcast

unsigned int btn1[] = {220,896,228,1692,228,736,224,2788,228,1280,224,1280,228,1148,228,2656,224,13776,220,896,224,2660,224,736,224,736,224,740,220,896,228,732,228,732,228,80334,220,896,224,1700,224,736,224,2788,224,1284,224,1280,224,1152,224,2660,224,13776,228,888,224,1568,224,1828,224,740,220,740,220,896,228,732,228,736,224};
unsigned int btn2[] = {220,896,228,1692,228,732,228,2788,224,1280,228,1280,228,1148,228,2656,224,13776,220,896,224,2504,228,732,228,732,228,732,228,1020,224,740,224,736,224,80334,224,892,232,1692,228,732,228,2784,232,1276,228,1280,228,1148,228,2652,228,13772,224,896,228,1432,224,1828,224,736,224,740,224,1020,224,740,220,740,220};
unsigned int btn3[] = {220,900,224,1696,224,736,224,2792,224,1280,224,1284,224,1152,224,2660,220,13780,228,888,224,2372,228,732,228,736,224,736,224,1152,224,736,224,736,224,80338,228,888,224,1700,220,740,220,2792,224,1284,220,1284,224,1156,220,2660,232,13768,228,888,224,1284,224,1828,224,736,224,736,224,1156,220,740,220,740,220};
unsigned int btn4[] = {228,888,224,1700,220,740,224,2788,224,1284,224,1284,220,1156,220,2664,220,13780,224,892,220,2248,220,740,220,740,220,740,224,1284,220,740,220,740,220,80342,224,892,228,1696,228,732,228,2784,228,1280,228,1276,232,1144,228,2656,228,13772,224,892,228,1148,228,1824,228,736,228,732,228,1280,224,736,228,732,228};
unsigned int btn5[] = {228,888,224,1700,220,740,224,2788,224,1284,284,1220,224,1152,224,2660,224,13776,280,836,224,2116,220,740,220,740,220,740,224,1440,276,684,228,732,228,80334,228,888,224,1700,220,740,224,2788,224,1284,224,1280,224,1156,220,2660,224,13776,228,888,224,1024,220,1832,220,740,224,740,220,1440,228,732,228,736,224};
unsigned int btn6[] = {224,892,228,1696,224,736,228,2788,224,1280,228,1280,228,1148,224,2660,224,13776,220,896,224,1956,228,732,228,736,228,732,228,1564,224,736,224,736,288,80290,224,892,228,1692,232,732,276,2736,280,1228,216,1288,220,1156,228,2656,228,13772,224,892,220,896,224,1828,228,736,224,736,224,1568,224,736,224,736,224};
unsigned int btn7[] = {228,888,224,1696,224,736,224,2792,224,1280,224,1284,224,1152,224,2660,220,13780,228,888,224,1828,224,736,224,736,224,740,224,1696,224,740,220,740,220,80354,220,896,228,1692,228,732,228,2788,228,1276,228,1280,228,1148,228,2656,224,13776,224,892,228,732,228,1824,228,732,232,732,228,1692,228,732,228,736,224};
unsigned int btn8[] = {228,888,224,1700,220,740,220,2792,224,1284,224,1280,224,1156,220,2660,224,13776,228,888,224,1700,220,740,224,736,224,740,220,1832,220,740,220,740,220,80342,220,896,228,1692,228,736,224,2788,228,1276,228,1280,228,1148,228,2656,224,13776,220,896,228,2784,228,1824,228,736,228,732,228,1824,228,732,228,732,228};
unsigned int btn9[] = {228,892,220,1700,224,736,224,2792,220,1284,224,1284,224,1152,220,2664,220,13780,224,892,220,1572,228,732,228,732,232,732,228,1952,220,740,232,732,228,80346,224,892,232,1692,228,732,228,2784,232,1276,228,1280,228,1148,228,2652,228,13772,224,896,228,2652,228,1824,228,736,276,684,232,1948,232,728,232,732,228};
unsigned int btn0[] = {228,888,224,1700,284,676,224,2788,284,1224,224,1280,224,1156,220,2660,232,13768,276,844,220,2792,220,740,224,736,224,736,224,740,220,740,220,740,232,80342,228,888,224,1700,224,736,224,2788,224,1284,224,1280,228,1152,220,2660,224,13776,228,888,224,1700,224,1828,224,736,224,736,224,740,220,740,224,736,224};
unsigned int btnEnter[] = {}; // forgot to save


//channel selection setup
//savedChannels[x] needs to be count of added channels as well as channelCount
const int savedChannels[11] = {136, 255, 814, 823, 832, 839, 854, 855, 863, 866, 872};
int channelCount = 11;
int currentChannel = 0;
int khz = 38;

IRsend irsend;

void setup()
{
  pinMode(PUSHBUTTON1, INPUT_PULLUP);
  //Serial.begin(9600);
  pinMode(ledPin, OUTPUT);
}

void loop() {
  if (digitalRead(PUSHBUTTON1) == LOW) {
    ledBlink();
    sendCommands(); }
}


void sendCommands(){
int testInt = savedChannels[currentChannel];
int press[3] = {999,999,999};
//Serial.println(testInt);
press[0] = testInt / 100;
press[1] = (testInt - press[0] * 100) / 10;
press[2] =  (testInt - (press[0] * 100) - (press[1] * 10)) / 1;

  for(int i = 0; i < 3; i++)
  {


  if (press[i] == 1)
  {
    irsend.sendRaw(btn1, sizeof(btn1)/sizeof(int), khz);
}
else if (press[i] == 2)
{
  irsend.sendRaw(btn2, sizeof(btn1)/sizeof(int), khz);;
}
else if (press[i] == 3)
{
  irsend.sendRaw(btn3, sizeof(btn1)/sizeof(int), khz);
}
else if (press[i] == 4)
{
  irsend.sendRaw(btn4, sizeof(btn1)/sizeof(int), khz);
}
else if (press[i] == 5)
{
  irsend.sendRaw(btn5, sizeof(btn1)/sizeof(int), khz);
}
else if (press[i] == 6)
{
  irsend.sendRaw(btn6, sizeof(btn1)/sizeof(int), khz);
}
else if (press[i] == 7)
{
  irsend.sendRaw(btn7, sizeof(btn1)/sizeof(int), khz);
}
else if (press[i] == 8)
{
  irsend.sendRaw(btn8, sizeof(btn1)/sizeof(int), khz);
}
else if (press[i] == 9)
{
  irsend.sendRaw(btn9, sizeof(btn1)/sizeof(int), khz);
}
else if (press[i] == 0)
{
  irsend.sendRaw(btn0, sizeof(btn1)/sizeof(int), khz);
}
else
{
}
//Pause between button presses
delay(500);
    }


//sends enter
irsend.sendRaw(btnEnter,36,38);
currentChannel = currentChannel + 1;
  if (currentChannel == 11) {
    currentChannel = 0;
  }
}

void ledBlink()
{
  digitalWrite(ledPin, HIGH);   // sets the LED on
  delay(250);                  // waits for a second
  digitalWrite(ledPin, LOW);    // sets the LED off
  delay(250);                  // waits for a second
  digitalWrite(ledPin, HIGH);   // sets the LED on
  delay(250);                  // waits for a second
  digitalWrite(ledPin, LOW);    // sets the LED off
  delay(250);                  // waits for a second
}


Hosting Services by ipHouse