Hi,
I'm stuck on a problem. Here I have a P10 LED panel and a 433Mhz transmitter/receiver pair.
When I put the two functions in the loop and press a button on the remote control I see the code value on the P10 panel screen. It is a numeric value with 7 to 10 characters. I just split the String to see the entire value, a chunk on the first line and the rest on the second line of the panel.
The problem is that the signal reception is terrible. It only works by bringing the control closer, 1 to 2 meters, and keeping the button pressed for a long time.
It's a timer problem between the two libraries, a kind of conflict.
I say this because I already placed the panel only to react by randomly lighting up LEDs when any signal reception occurred. And then the range became tens of meters. I pressed the remote control button and saw some LEDs flash on the panel.
This means that there is nothing wrong with 433Mhz communication, I mean, nothing wrong with the TX/RX modules.
How does this code have to be so that reception of the 433Mhz signal occurs normally, that is, without the problem described above ?
Does anyone have any...try this ?
#include <RCSwitch.h>
#include <DMDESP.h>
#include <fonts/Mono5x7.h>
//----------------------------------------DMD Configuration (P10 Panel)
#define DISPLAYS_WIDE 1 //--> Panel Columns
#define DISPLAYS_HIGH 1 //--> Panel Rows
DMDESP Disp(DISPLAYS_WIDE, DISPLAYS_HIGH); //--> Number of Panels P10 used (Column, Row)
//----------------------------------------
RCSwitch mySwitch = RCSwitch();
int cron;
String codereceiver,codereceiver_a;
void setup() {
Serial.begin(115200);
mySwitch.enableReceive(4); // Receiver on interrupt 0 => that is pin #2
//----------------------------------------DMDESP Setup
Disp.start(); //--> Run the DMDESP library
Disp.setBrightness(15); //--> Brightness level
Disp.setFont(Mono5x7); //--> Determine the font used
//----------------------------------------
}
void loop() {
// cron++;
if (mySwitch.available()) {
codereceiver = mySwitch.getReceivedValue();
Serial.println( mySwitch.getReceivedValue() );
mySwitch.resetAvailable();
}
codereceiver_a = codereceiver;
codereceiver_a.remove(0,5);
Disp.loop();
Disp.drawText(0, 0, codereceiver);
Disp.drawText(0, 9, codereceiver_a);
}
Thanks