Hi, n0()b here hoping I I get the forum rules right.
I have a grove 4-Channel Relay I want to control with a Adafruit QT-Py ESP32-S2 through the I2C stemma port. I know the QTPY and relay both work on their own but I can’t get the “four_channel_realy_control.ino” example to run on the qtpy. Compiling w/ Arduino IDE v2.0.0,
Every time I compile I get the error:
In file included from C:\Users\me\Documents\Arduino\WIFI RELay\WIFI RELay\WIFI RELay.ino:3:
c:\Users\me\Documents\Arduino\libraries\Multi_Channel_Relay_Arduino_Library-master/multi_channel_relay.h:40:50: note: #pragma message: Not match any architecture.
#pragma message(“Not match any architecture.”)
^
It still uploads more or less and I get serial back like it’s running correctly. but nothing happens on the grove.
I though it might be cuz the diff logic levels so I put a logic level converter inline b/t the qtpy and grove board but still nothing.
I’d send a circuit diagram but I can’t upload yet. So here’s something far less useful:
||Grove 4Ch|| <-/->||LogicLevelConv||<-/->||QTPY||
Here’s my code:
#include <multi_channel_relay.h>
#include <Adafruit_BusIO_Register.h>
#include <Adafruit_I2CDevice.h>
#include <Adafruit_I2CRegister.h>
#include <Adafruit_SPIDevice.h>
#include <Adafruit_TestBed.h>
/**
channle: 4 3 2 1
state: 0b0000 -> 0x00 (all off)
state: 0b1111 -> 0x0f (all on)
*/
Multi_Channel_Relay relay;
void setup() {
DEBUG_PRINT.begin(115200);
while (!DEBUG_PRINT);
// Set I2C address and start relay
relay.begin(0x11);
}
void loop() {
/* Begin Controlling Relay */
DEBUG_PRINT.println("Channel 1 on");
relay.turn_on_channel(1);
delay(500);
DEBUG_PRINT.println("Channel 2 on");
relay.turn_off_channel(1);
relay.turn_on_channel(2);
delay(500);
DEBUG_PRINT.println("Channel 3 on");
relay.turn_off_channel(2);
relay.turn_on_channel(3);
delay(500);
DEBUG_PRINT.println("Channel 4 on");
relay.turn_off_channel(3);
relay.turn_on_channel(4);
delay(500);
relay.turn_off_channel(4);
relay.channelCtrl(CHANNLE1_BIT |
CHANNLE2_BIT |
CHANNLE3_BIT |
CHANNLE4_BIT);
DEBUG_PRINT.print("Turn all channels on, State: ");
DEBUG_PRINT.println(relay.getChannelState(), BIN);
delay(2000);
relay.channelCtrl(CHANNLE1_BIT |
CHANNLE3_BIT);
DEBUG_PRINT.print("Turn 1 3 channels on, State: ");
DEBUG_PRINT.println(relay.getChannelState(), BIN);
delay(2000);
relay.channelCtrl(CHANNLE2_BIT |
CHANNLE4_BIT);
DEBUG_PRINT.print("Turn 2 4 channels on, State: ");
DEBUG_PRINT.println(relay.getChannelState(), BIN);
delay(2000);
relay.channelCtrl(0);
DEBUG_PRINT.print("Turn off all channels, State: ");
DEBUG_PRINT.println(relay.getChannelState(), BIN);
delay(2000);
}