Pages: [1]   Go Down
Author Topic: IR Remote hacking  (Read 1568 times)
0 Members and 2 Guests are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi all i want to hack my rgb led strip remote to control the rgb strip via computer using serial monitor  i am using arduino uno and ir receiver and ir transmitter  i have success in receiving the ir codes but i fail in transmit it again using   ir transmitter i connect the ir transmitter  the long leg in the GND and the short one in pin 3 and try it but it do not work and i try to see on the camara but it did not work also Sry for my bad english
Code:
/*
irSend sketch
this code needs an IR LED connected to pin 3
*/
#include <IRremote.h>
// IR remote control library
const int numberOfKeys = 4;
long irKeyCodes[numberOfKeys] = {
    0x18E758A7, 0x18E758A9, 0x18E758B7, 0x18E758C7
};

IRsend irsend;
void setup()
{
    Serial.begin(9600);
}
void loop() {
    char c;
    if (Serial.available())
    c=Serial.read();
    switch(c){
    case 'a':
    irsend.sendSony(irKeyCodes[0], 32);
    Serial.println("Sending a");
    break;
    case 'b':
    irsend.sendSony(irKeyCodes[1], 32);
    Serial.println("Sending b");
    break;
    case 'c':
    irsend.sendSony(irKeyCodes[2], 32);
    Serial.println("Sending c");
    break;
    case 'd':
    irsend.sendSony(irKeyCodes[3], 32);
    Serial.println("Sending 3");
    break;
    }
   
   
}
Logged

BCC AZ USA
Offline Offline
God Member
*****
Karma: 21
Posts: 937
It gets hot so it must be working
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The long leg of most LEDs is the positive side.  Any LED should have a current limiting resistor.  An IR LED may take more current than a digital output can handle (20mA max safe curretn 40ma absolute maximum) to be effective.
Logged

Dublin, Ireland
Offline Offline
Sr. Member
****
Karma: 12
Posts: 387
AnalysIR - IR Analyzer & Decoder for Arduino & MCUs
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

A possible problem with your code:

- Most Sony protocol variants are not 32 bits (20 bits is the max I have seen)
- My guess is that you should be sending as NEC (I think most of these LED devices use the NEC IR protocol.


So try changing 'sendSONY' to 'sendNEC' in your code.
Logged

Blog: http://www.AnalysIR.com/blog/     Twitter: @AnalysIR
Read ==> 10 common pitfalls with Infrared Remote Control :  http://bit.ly/1cvd0a

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

A possible problem with your code:

- Most Sony protocol variants are not 32 bits (20 bits is the max I have seen)
- My guess is that you should be sending as NEC (I think most of these LED devices use the NEC IR protocol.


So try changing 'sendSONY' to 'sendNEC' in your code.
yes your true thanks alot
Logged

Dublin, Ireland
Offline Offline
Sr. Member
****
Karma: 12
Posts: 387
AnalysIR - IR Analyzer & Decoder for Arduino & MCUs
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Great - glad to be of help  smiley
Logged

Blog: http://www.AnalysIR.com/blog/     Twitter: @AnalysIR
Read ==> 10 common pitfalls with Infrared Remote Control :  http://bit.ly/1cvd0a

Pages: [1]   Go Up
Jump to: