@scamilleri1228 an you send a pic of your connection of esp8266 with relay module.
@scamilleri1228 this worked for me and is this wat you want? i had connected a led between NC and com terminal.
// This example shows how to connect to Cayenne using an ESP8266 and send/receive sample data.
// Make sure you install the ESP8266 Board Package via the Arduino IDE Board Manager and select the correct ESP8266 board before compiling.
//#define CAYENNE_DEBUG
#define CAYENNE_PRINT Serial
#include <CayenneMQTTESP8266.h>
int x;
// WiFi network info.
char ssid[] = "";
char wifiPassword[] = "";
// Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
char username[] = "";
char password[] = "";
char clientID[] = "";
unsigned long lastMillis = 0;
void setup() {
Serial.begin(9600);
pinMode(4, OUTPUT);
digitalWrite(4,HIGH);
Cayenne.begin(username, password, clientID, ssid, wifiPassword);
}
void loop() {
Cayenne.loop();
}
CAYENNE_IN(1)
{
int currentValue = getValue.asInt();
if (currentValue == 1)
{
x = 1;
Serial.println("x is 1");
digitalWrite(4, HIGH);
}
else
{
x = 0;
Serial.println("x is 0");
digitalWrite(4, LOW);
}
}
shramiksalgaonkar
November 8
@scamilleri1228 this worked for me and is this wat you want? i had connected a led between NC and com terminal.// This example shows how to connect to Cayenne using an ESP8266 and send/receive sample data.
// Make sure you install the ESP8266 Board Package via the Arduino IDE Board Manager and select the correct ESP8266 board before compiling.//#define CAYENNE_DEBUG
#define CAYENNE_PRINT Serial
#include <CayenneMQTTESP8266.h>
int x;
// WiFi network info.
char ssid = ββ;
char wifiPassword = ββ;// Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
char username = ββ;
char password = ββ;
char clientID = ββ;unsigned long lastMillis = 0;
void setup() {
Serial.begin(9600);
pinMode(4, OUTPUT);
digitalWrite(4,HIGH);
Cayenne.begin(username, password, clientID, ssid, wifiPassword);
}void loop() {
Cayenne.loop();}
CAYENNE_IN(1)
{
int currentValue = getValue.asInt();
if (currentValue == 1)
{
x = 1;
Serial.println(βx is 1β);
digitalWrite(4, HIGH);
}
else
{
x = 0;
Serial.println(βx is 0β);
digitalWrite(4, LOW);
}
}
Visit Topic or reply to this email to respond.To unsubscribe from these emails, click here.
Thatβs did it, thank you again for sticking with me through this.