GETTING A COMPILE ERROR
SENSOR PIN6 WAS NOT DECLARED IN THIS SCOPE
#define CAYENNE_PRINT Serial // Comment this out to disable prints and save space
#include <OneWire.h>
#include <DallasTemperature.h>
#include <CayenneMQTTEthernetW5500.h>
// Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
char username[] = "XXXXXX";
char password[] = "XXXXXX";
char clientID[] = "XXXXXXX";
// Do not use digital pins 0 or 1 since those conflict with the use of Serial.
#define SENSOR_PIN0 A0
#define VIRTUAL_CHANNEL1 V1
#define SENSOR_PIN1 A1
#define VIRTUAL_CHANNEL2 V2
#define SENSOR_PIN2 A2
#define VIRTUAL_CHANNEL3 V3
#define SENSOR_PIN3 A3
#define VIRTUAL_CHANNEL4 V4
#define SENSOR_PIN 5
#define VIRTUAL_CHANNEL V5
#define SENSOR_PIN 6
#define VIRTUAL_CHANNEL V6
// Digital pin the DS18B20 is connected to. Do not use digital pins 0 or 1 since those conflict with the use of Serial.
const int tmpPin6 = 6;
const int tmpPin5 = 5;
OneWire oneWire6(SENSOR_PIN6);
OneWire oneWire5(SENSOR_PIN5);
DallasTemperature sensors6(&oneWire6);
DallasTemperature sensors5(&oneWire5);
void setup()
{
Serial.begin(9600);
Cayenne.begin(username, password, clientID);
sensors.begin();
}
void loop()
{
Cayenne.loop();
}
// This function is called at intervals to send sensor data to Cayenne.
CAYENNE_OUT(VIRTUAL_CHANNEL5)
{
// Send the command to get temperatures.
sensors5.requestTemperatures();
// This command writes the temperature in Celsius to the Virtual Channel.
//Cayenne.celsiusWrite(VIRTUAL_CHANNEL, sensors.getTempCByIndex(0));
// To send the temperature in Fahrenheit use the corresponding code below.
Cayenne.fahrenheitWrite(VIRTUAL_CHANNEL, sensors.getTempFByIndex(0));
}
CAYENNE_OUT(VIRTUAL_CHANNEL6)
{
// Send the command to get temperatures.
sensors6.requestTemperatures();
// This command writes the temperature in Celsius to the Virtual Channel.
//Cayenne.celsiusWrite(VIRTUAL_CHANNEL, sensors.getTempCByIndex(0));
// To send the temperature in Fahrenheit use the corresponding code below.
Cayenne.fahrenheitWrite(VIRTUAL_CHANNEL, sensors.getTempFByIndex(0));
}
// This function is called at intervals to send sensor data to Cayenne.
CAYENNE_OUT(VIRTUAL_CHANNEL1)
{
Cayenne.virtualWrite(VIRTUAL_CHANNEL1, analogRead(SENSOR_PIN0));
}
//This function is called at intervals to send sensor datato Cayenne.
CAYENNE_OUT(VIRTUAL_CHANNEL2)
{
Cayenne.virtualWrite(VIRTUAL_CHANNEL2, analogRead(SENSOR_PIN1));
}
//This function is called at intervals to send sensor datato Cayenne.
CAYENNE_OUT(VIRTUAL_CHANNEL3)
{
Cayenne.virtualWrite(VIRTUAL_CHANNEL3, analogRead(SENSOR_PIN2));
}
// This function is called at intervals to send sensor data to Cayenne.
CAYENNE_OUT(VIRTUAL_CHANNEL4)
{
Cayenne.virtualWrite(VIRTUAL_CHANNEL4, analogRead(SENSOR_PIN3));
}