user70166: Good afternoon! This question is still relevant to me. I use the receiver module in conjunction with arduino. I want to use my own transfer protocol and now I need to accept it. I tried to use various libraries, but all without success. I need to somehow select a sequence of pulses and then determine their values ​​(zero or one) by the duration of the pulses.
But first, I need to determine the beginning of the signal from the preamble (12 pulses at the beginning). I wrote a program that draws a graph where you can see the entire sequence.
Is it possible to define this preamble without using libraries, for example, to make a cycle that will measure the length of the pulses, and there are 12 times the duration of the pulses will be the same, then this is the preamble, followed by digital data.
#define IN_PIN 2
void setup() 
{
  Serial.begin(115200);
}

void loop() 
{
  bool s = digitalRead(IN_PIN);
  Serial.println(s);
}




user52659: It is not working because of:
SPEED
Consider the frequency of the 433Mhz device vs. the speed of the serial monitor. The device sends signals with pulse width in the range of tens of microseconds while the serial monitor can't display that fast.
Your code should analyze the signals, clean the noise (the output of the device is very noisy) and figure out the protocol. All that is done by dedicated libraries such as rc-switch which is very extensive and robust compared to just reading a pin and plotting the output.
DIGITAL
The recover device is outputting a digital pulse which based on it's pulse width changes one can figure out the sequence of numbers sent by the remote control. Each such ASK protocol has it's timing characteristics which you should follow in order to decode the code.
If you want to experiment with that vs. using a ready made library you should start with a code similar to the example below.
void setup() {
  Serial.begin(6000000);
  attachInterrupt(digitalPinToInterrupt(1), handleInterrupt, CHANGE);
}

void loop() {
}

void handleInterrupt() {
  bool s = digitalRead(1);
  Serial.println(s);
}

Just pay attention to the timing issue, this code will show a lot of data but not necessarily (almost for sure) not all the data, but you can avoid the serial print and use the data for analysis.

70166: <p>Good afternoon! This question is still relevant to me. I use the receiver module in conjunction with arduino. I want to use my own transfer protocol and now I need to accept it. I tried to use various libraries, but all without success. I need to somehow select a sequence of pulses and then determine their values ​​(zero or one) by the duration of the pulses.
But first, I need to determine the beginning of the signal from the preamble (12 pulses at the beginning). I wrote a program that draws a graph where you can see the entire sequence.
Is it possible to define this preamble without using libraries, for example, to make a cycle that will measure the length of the pulses, and there are 12 times the duration of the pulses will be the same, then this is the preamble, followed by digital data.</p>
<pre><code>#define IN_PIN 2
void setup() 
{
  Serial.begin(115200);
}

void loop() 
{
  bool s = digitalRead(IN_PIN);
  Serial.println(s);
}
</code></pre>
<p><a href="https://i.stack.imgur.com/BNVAu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BNVAu.png" alt="enter image description here" /></a></p>
<p><a href="https://i.stack.imgur.com/1TWvp.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1TWvp.jpg" alt="enter image description here" /></a></p>
 52659: <p>It is not working because of:</p>
<p><strong>SPEED</strong></p>
<p>Consider the frequency of the 433Mhz device vs. the speed of the serial monitor. The device sends signals with pulse width in the range of tens of microseconds while the serial monitor can't display that fast.</p>
<p>Your code should analyze the signals, clean the noise (the output of the device is very noisy) and figure out the protocol. All that is done by dedicated libraries such as <a href="https://github.com/sui77/rc-switch" rel="nofollow noreferrer">rc-switch</a> which is very extensive and robust compared to just reading a pin and plotting the output.</p>
<p><strong>DIGITAL</strong></p>
<p>The recover device is outputting a digital pulse which based on it's pulse width changes one can figure out the sequence of numbers sent by the remote control. Each such ASK protocol has it's timing characteristics which you should follow in order to decode the code.</p>
<p>If you want to experiment with that vs. using a ready made library you should start with a code similar to the example below.</p>
<pre><code>void setup() {
  Serial.begin(6000000);
  attachInterrupt(digitalPinToInterrupt(1), handleInterrupt, CHANGE);
}

void loop() {
}

void handleInterrupt() {
  bool s = digitalRead(1);
  Serial.println(s);
}
</code></pre>
<p>Just pay attention to the timing issue, this code will show a lot of data but not necessarily (almost for sure) not all the data, but you can avoid the serial print and use the data for analysis.</p>
