Dmd.begin() not working with RCSwitch.h

I am displaying messages on a P10 led panel using DMD2. But I also need to control some functions on this panel using a RF433Mhz remote using RCSwitch.h

But the two together does not work. When I write dmd.begin() the interrupt handler is on and it seems to interrupt the RCSwitch which also uses interrupt, mySwitch.enableReceive(0);

How do I resolve this?

#include <DMD2.h>
#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();

SoftDMD dmd(1,1);

void setup() {
  Serial.begin(115200);
  mySwitch.enableReceive(0);  // Receiver on interrupt 0 => that is pin #2
  pinMode(LED_BUILTIN, OUTPUT);
  dmd.begin();
}

void loop() {
  
  if (mySwitch.available()) {
    
    int value = mySwitch.getReceivedValue();
    
    if (value == 0) {
      Serial.print("Unknown encoding");
    } else {
   
     Serial.print("Received ");
      Serial.print( mySwitch.getReceivedValue() );
      Serial.print(" / ");
      Serial.print( mySwitch.getReceivedBitlength() );
      Serial.print("bit ");
      Serial.print("Protocol: ");
      Serial.println( mySwitch.getReceivedProtocol() );
    }

    if (mySwitch.getReceivedValue() == 140160853) {
       digitalWrite(LED_BUILTIN, HIGH);
      }
    if (mySwitch.getReceivedValue() == 140160869) {
      digitalWrite(LED_BUILTIN, LOW);
      }
      
    mySwitch.resetAvailable();
  }

}

Friends, I tested several codes here with several google libraries and none of them works together with DMD2 and RCSwitch.h

I'd like to use a garage remote to just modify a value on the dashboard. And it could even be like this:

When I use the remote, the panel stops working, as if inhibiting the DMD2.h library.

Nobody knows this one ?

The BUILTIN LED only lights up from the remote control button if I comment out the line dmd.begin(); in the setup

If it is impossible for the two libraries to work together, could you disable the interrupt for a moment? or I don't know, apply some other solution even if it's not the best ?

My most recent attempt was to open the DMD2_timer.cpp file and uncomment the line that uses or does not use Timer and I started to include the TimerOne.h library but it didn't work either

Does anyone have any ideas ?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.