Pages: [1]   Go Down
Author Topic: Issue controlling TV with Arduino  (Read 652 times)
0 Members and 1 Guest are viewing this topic.
USA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 68
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've been playing around with controlling my TVs with my Arduino Uno.  The two TVs that I've been controlling are a Dynex and an Insignia that use the same NEC protocol and the same codes.  Using the code below works perfectly on the Dynex but for some reason with the Insignia instead of receiving "7.3" It gets "77.33"
Code:
/*
 * IRremote: IRsendDemo - demonstrates sending IR codes with IRsend
 * An IR LED must be connected to Arduino PWM pin 3.
 * Version 0.1 July, 2009
 * Copyright 2009 Ken Shirriff
 * http://arcfn.com
 */
#include <IRremote.h>

IRsend irsend;

void setup()
{
 
}

void loop() {
 delay(3000);
  for (int i = 0; i < 3; i++) {
      irsend.sendNEC(0x61A0F00F,32); // powerup
      delay(40);
    }
   
    delay(12000);
    for (int i = 0; i < 3; i++) {
      irsend.sendNEC(0x61A0609F,32); // 7
      delay(40);
    }
    delay(300);
    for (int i = 0; i < 3; i++) {
      irsend.sendNEC(0x61A0827D,32); // .
      delay(40);
    }
    delay(300);
    for (int i = 0; i < 3; i++) {
      irsend.sendNEC(0x61A040BF,32); // 3
      delay(40);
    }
    delay(300);
    for (int i = 0; i < 3; i++) {
      irsend.sendNEC(0x61A018E7,32); // enter
      delay(40);
    }
    delay(15000);
}
Logged

New Jersey
Offline Offline
Faraday Member
**
Karma: 48
Posts: 3402
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Without knowing anything about what you're doing and just reading the code, it appears that you're sending each character three times. Apparently, the Insignia notices the repetition to some extent but the Dynix doesn't.
Logged

USA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 68
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks, that what was going on, so obvious now!
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 106
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

just delete the "for" loop
Logged

Pages: [1]   Go Up
Jump to: