Go Down

Topic: IR Remote hacking (Read 2173 times) previous topic - next topic

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: [Select]

/*
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;
    }
   
   
}

groundfungus

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.

AnalysIR

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.
Visit our Blog about Infrared Remote Control >>>> http://www.AnalysIR.com/blog/  Twitter: @AnalysIR
First Read this PDF=> 10 common pitfalls with Infrared Remote Control >>> http://bit.ly/1cvd0at


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

AnalysIR

Great - glad to be of help  :)
Visit our Blog about Infrared Remote Control >>>> http://www.AnalysIR.com/blog/  Twitter: @AnalysIR
First Read this PDF=> 10 common pitfalls with Infrared Remote Control >>> http://bit.ly/1cvd0at

Go Up