My project is not arduino. One to trigger 4 relays work normal, when I switched to MQTT I can not add the second trigger (relay). We advise you to add it first using a sketch or code, but I have questions about how to write the code for the next triggers together. In the middle code only the first relay, how do I put 4 or more?
#define CAYENNE_PRINT Serial // Comment this out to disable prints and save space
// Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
char username = “6xxxxxx”;
char password = “8xxxxxx”;
char clientID = “7axxxxxx”;
#define VIRTUAL_CHANNEL 8
#define ACTUATOR_PIN 4 // Do not use digital pins 0 or 1 since those conflict with the use of Serial.
pinMode(ACTUATOR_PIN , OUTPUT);
Cayenne.begin(username, password, clientID);
// This function is called when data is sent from Cayenne.
int value = getValue.asInt();
CAYENNE_LOG(“Channel %d, pin %d, value %d”, VIRTUAL_CHANNEL, ACTUATOR_PIN , value);
// Write the value received to the digital pin.
digitalWrite(ACTUATOR_PIN , value);