Hello,
I'm trying to analyze a 433Mhz signal from a remote control using a receiver module and a remote control to send the signal.
Here is my code for the receiver :
#include <RH_ASK.h> // (fait partie de Radiohead)
#include <SPI.h>
// Create Amplitude Shift Keying Object
RH_ASK driver(2000, 11, 12, 10, true);
void setup()
{
Serial.begin(9600);
if (!driver.init()) {
Serial.println("Couldn't initialize RadioHead driver");
} else {
Serial.println("Successfully initialized RadioHead driver");
}
}
void loop()
{
uint8_t buf[RH_ASK_MAX_MESSAGE_LEN];
uint8_t buflen = sizeof(buf);
int digitalRead11Value = digitalRead(11);
Serial.println(digitalRead11Value);
if (driver.recv(buf, &buflen)) // Non-blocking
{
driver.printBuffer("Got:", buf, buflen);
}
}
My problem is the "driver.recv" function is always returning false, I tried to print the value of digitalRead(11) and when I press my remote button to send the signal it's printing something different. It behave like this below
************ REMOTE BUTTON NOT PRESSED ************
16:14:26.282 -> 0
16:14:26.282 -> 0
16:14:26.315 -> 0
16:14:26.315 -> 0
16:14:26.315 -> 0
16:14:26.315 -> 0
16:14:26.315 -> 1
16:14:26.315 -> 0
16:14:26.315 -> 0
16:14:26.315 -> 1
16:14:26.315 -> 1
16:14:26.315 -> 1
16:14:26.349 -> 0
16:14:26.349 -> 0
16:14:26.349 -> 1
16:14:26.349 -> 0
16:14:26.349 -> 0
16:14:26.349 -> 0
16:14:26.349 -> 0
16:14:26.349 -> 0
16:14:26.349 -> 0
16:14:26.349 -> 0
16:14:26.349 -> 0
16:14:26.382 -> 0
16:14:26.382 -> 1
16:14:26.382 -> 0
16:14:26.382 -> 0
16:14:26.382 -> 1
16:14:26.382 -> 0
16:14:26.382 -> 0
16:14:26.382 -> 1
16:14:26.382 -> 0
16:14:26.382 -> 1
16:14:26.415 -> 1
************ REMOTE BUTTON PRESSED ************
16:14:26.415 -> 0
16:14:26.415 -> 0
16:14:26.415 -> 0
16:14:26.415 -> 0
16:14:26.415 -> 0
16:14:26.415 -> 0
16:14:26.415 -> 0
16:14:26.415 -> 0
16:14:26.415 -> 0
16:14:26.415 -> 0
16:14:26.448 -> 0
16:14:26.448 -> 0
16:14:26.448 -> 0
16:14:26.448 -> 0
16:14:26.448 -> 0
16:14:26.448 -> 0
16:14:26.448 -> 0
16:14:26.448 -> 0
16:14:26.448 -> 0
16:14:26.448 -> 0
16:14:26.481 -> 0
16:14:26.481 -> 0
16:14:26.481 -> 0
16:14:26.481 -> 0
16:14:26.481 -> 0
16:14:26.481 -> 0
16:14:26.481 -> 0
16:14:26.481 -> 0
16:14:26.481 -> 0
16:14:26.481 -> 0
16:14:26.481 -> 0
16:14:26.514 -> 0
16:14:26.514 -> 0
16:14:26.514 -> 0
16:14:26.514 -> 0
16:14:26.514 -> 0
16:14:26.514 -> 0
16:14:26.514 -> 0
16:14:26.514 -> 0
16:14:26.514 -> 1
16:14:26.514 -> 1
16:14:26.514 -> 1
16:14:26.514 -> 1
16:14:26.548 -> 1
16:14:26.548 -> 1
16:14:26.548 -> 1
16:14:26.548 -> 1
16:14:26.548 -> 1
16:14:26.548 -> 1
16:14:26.548 -> 1
16:14:26.548 -> 1
16:14:26.548 -> 1
16:14:26.548 -> 1
16:14:26.581 -> 1
16:14:26.581 -> 1
16:14:26.581 -> 1
16:14:26.581 -> 1
16:14:26.581 -> 1
16:14:26.581 -> 1
16:14:26.581 -> 1
16:14:26.581 -> 1
16:14:26.581 -> 1
16:14:26.581 -> 1
16:14:26.581 -> 1
16:14:26.614 -> 1
16:14:26.614 -> 1
16:14:26.614 -> 1
16:14:26.614 -> 1
16:14:26.614 -> 1
16:14:26.614 -> 1
16:14:26.614 -> 1
16:14:26.614 -> 1
16:14:26.614 -> 1
16:14:26.614 -> 1
16:14:26.647 -> 1
16:14:26.647 -> 1
16:14:26.647 -> 1
16:14:26.647 -> 1
16:14:26.647 -> 1
16:14:26.647 -> 1
16:14:26.647 -> 1
16:14:26.647 -> 1
16:14:26.647 -> 1
16:14:26.647 -> 1
16:14:26.647 -> 1
16:14:26.680 -> 1
16:14:26.680 -> 1
16:14:26.680 -> 1
16:14:26.680 -> 1
16:14:26.680 -> 1
16:14:26.680 -> 1
16:14:26.680 -> 1
16:14:26.680 -> 1
16:14:26.680 -> 1
16:14:26.680 -> 1
16:14:26.714 -> 1
16:14:26.714 -> 1
16:14:26.714 -> 1
16:14:26.714 -> 1
16:14:26.714 -> 1
16:14:26.714 -> 1
16:14:26.714 -> 1
16:14:26.714 -> 1
16:14:26.714 -> 1
16:14:26.714 -> 1
16:14:26.714 -> 1
16:14:26.747 -> 1
16:14:26.747 -> 1
16:14:26.747 -> 1
16:14:26.747 -> 1
16:14:26.747 -> 1
16:14:26.747 -> 1
16:14:26.747 -> 1
16:14:26.747 -> 1
Can someone help me ?
Receiver module is this one : Kit émetteur-récepteur 433MHZ - Articles retires | GO TRONIC