H
H
Heinrich Schulz2014-08-20 06:19:11
Arduino
Heinrich Schulz, 2014-08-20 06:19:11

How to decrypt the data coming from the IR remote control?

There is a remote control from the Gyro helicopter 24019_big.jpgand an IR sensor from the same helicopter.
The sensor is connected to the Arduino, below is the sketch. When I give gas on the remote control , the serial
port receives the following :

#include <IRremote.h>
int RECEIVE_PIN = 2;
IRrecv irrecv(RECEIVE_PIN);
decode_results results;
int a, b, c, d;
 
void setup() 
   {
    Serial.begin(9600);
    irrecv.enableIRIn();
   }
 
void loop() 
   {
     if (irrecv.decode(&results)) 
        {
     //Serial.println("0x");     
     //Serial.println(results.value, HEX);
     a=(results.value&0x000000FF); 
     b=(results.value&0x0000FF00)>>8; 
     c=(results.value&0x00FF0000)>>16; 
     d=(results.value&0xFF000000)>>24;
     Serial.print(a);Serial.print(".");
     Serial.print(b);Serial.print(".");
     Serial.print(c);Serial.print(".");
     Serial.println(d);
     delay(50);
     irrecv.resume();
       }
   }

UPD. Tried to do this: Arduino + IRremote.h + toy helicopter remote control?
Outputs the following:
6DB6983E
Unknown encoding: 6DB6983E (32 bits)
Raw (68): 8686 2000 -1900 300 -300 300 -300 250 -750 250 -700 300 -700 300 -700 300 -700 300 -700 300 -250 300 - 300 300 -700 300 -700 350 -650 300 -650 350 -650 350 -650 250 -750 250 -350 250 -300 350 -250 300 -300 300 -300 300 -350 200 -400 200 -350 250 -3 -300 300 -300 300 -350 250 -350 250 -350 200 -750 250

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Denis, 2014-08-20
@cjbars

Try to represent the data in binary. Perhaps some logic will appear.
Most often, data is transmitted in binary form. For example, the first bit means the direction of rotation. Etc

Y
Yegor S, 2014-08-20
@gorbln

Yeah, and even in the RU subject, it is customary to encode control signals for the pulse width, where 1000 µs is 0%, and 2000 µs is 100% of the control channel. I will never be surprised if all control channels are transmitted via IR one after another in exactly this "encoding". And to separate the packs of channels, a pause is used. Well, that is ((2 + 2) * 4) + 4ms pause for separating packs.
In general, if there is an oscilloscope, it would be nice to cling to the LED on the remote control and see what is coming to it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question