Multi_Channel_Relay_Arduino_Library works with Windows 10 but not 11

I am trying to upload a very simple program to the UNO R4 Minima. I am using a Grove - 4-Channel Solid State Relay. This worked fine on Windows 10 machine but not that I switched to Windows 11 the Library will not pass “Verify” .

The error - In file included from C:\Users\Documents\Arduino\libraries\Multi_Channel_Relay_Arduino_Library\multi_channel_relay.cpp:25:0:
C:\Users\Arduino\libraries\Multi_Channel_Relay_Arduino_Library/multi_channel_relay.h:40:50: note: #pragma message: Not match any architecture. #pragma message(“Not match any architecture.”)

I have downloaded the library from HERE: Multi_Channel_Relay_Arduino

I have uninstalled the library and also tried the previous version 1.0. I am not sure how else to troubleshoot this. Are there any recommendations?

the architecture error seems to indicate that it does not recognize the R4 board you are using, do you have a different board?

1 Like

Thanks @cgwaltney :slightly_smiling_face:

Not yet. I can buy an R3 Uno or something. I will check to see what this will accept.

I was thinking dip your toes into the XIAO Family… Seeduino XIAO or ESP32

1 Like

Good idea. I am trying to make an encoder simulator for my next project and need to simulate A B channels at about 1200 Hz. Is there some type of ‘relay’ to switch the DC signal (2 of them A B) that fast? I will post this in the forum as a new question also.

you should be able to do this

1 Like

That issue is also present in Windows 10 if the device architecture is not known or explicitly supported by the library.

Since it is for the Serial interface, it should work fine (it should still build).

// Architecture specific include
#if defined(ARDUINO_ARCH_AVR)
    #define DEBUG_PRINT Serial
#elif defined(ARDUINO_ARCH_SAM)
    #define DEBUG_PRINT SerialUSB
#elif defined(ARDUINO_ARCH_SAMD)
    #define DEBUG_PRINT SerialUSB
#elif defined(ARDUINO_ARCH_STM32F4)
    #define DEBUG_PRINT SerialUSB
#else
    #pragma message("Not match any architecture.")
    #define DEBUG_PRINT Serial
#endif

Do you get any other errors? Is the board installed?

Here’s some simple code generated by their AI assistant(Circuit Designer) I tested with… not using MutliChannelRelay, just port IO.

Edit>NB. It doesn’t do Rotary Encoding. For that, check this Wokwi project.

/*
  Arduino Sketch for Simulating a Rotary Encoder
  This code simulates a rotary encoder with a 2-channel output. The output
  frequency is set to 1200Hz. The position and rate can be adjusted via the
  Serial interface.
*/

const int channelA = 8; // Pin for channel A output
const int channelB = 9; // Pin for channel B output
const int outputFrequency = 1200; // Frequency in Hz
volatile int position = 0; // Encoder position
int rate = 1; // Rate of position change

void setup() {
  pinMode(channelA, OUTPUT);
  pinMode(channelB, OUTPUT);
  Serial.begin(9600);
  Serial.println("Rotary Encoder Simulator");
}

void loop() {
  static unsigned long lastToggleTime = 0;
  unsigned long currentTime = micros();
  unsigned long interval = 1000000 / outputFrequency;

  if (currentTime - lastToggleTime >= interval) {
    lastToggleTime = currentTime;
    position += rate;
    digitalWrite(channelA, (position & 0x01) ? HIGH : LOW);
    digitalWrite(channelB, (position & 0x02) ? HIGH : LOW);
  }

  if (Serial.available() > 0) {
    char command = Serial.read();
    if (command == 'p') {
      Serial.print("Position: ");
      Serial.println(position);
    } else if (command == 'r') {
      Serial.print("Rate: ");
      Serial.println(rate);
    } else if (command == '+') {
      rate++;
      Serial.print("Rate increased to: ");
      Serial.println(rate);
    } else if (command == '-') {
      rate--;
      Serial.print("Rate decreased to: ");
      Serial.println(rate);
    }
  }
}

What loads do you want to switch? G3MB has limits, and require AC.
A simple motor driver should be able to switch as your frequencies.

1 Like

I will test this today. Thank you.

1 Like

It is loading fine with the warning and the relays are working. Thanks

1 Like