Answer the question
In order to leave comments, you need to log in
How to decrypt the data coming from the IR remote control?
There is a remote control from the Gyro helicopter and 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();
}
}
Answer the question
In order to leave comments, you need to log in
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
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 questionAsk a Question
731 491 924 answers to any question