Wemos D1 Mini to pressure Transducer 0-5v 1.2Mpa
I tried to make the sketch using A0 analogue in to read the out put of pressure trnasducer
but cayenne not updating the readings
Sketch below
define CAYENNE_PRINT Serial
#include <CayenneMQTTESP8266.h>
char ssid[] = "";
char wifiPassword[] = "";
// Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
char username[] = "";
char password[] = "";
char clientID[] = "";
#define SENSOR_PIN A0
#define VIRTUAL_CHANNEL 2
void setup()
{
Serial.begin(9600);
Cayenne.begin(username, password, clientID);
}
void loop()
{
Cayenne.loop();
}
// This function is called at intervals to send sensor data to Cayenne.
CAYENNE_OUT(VIRTUAL_CHANNEL)
{
Cayenne.virtualWrite(VIRTUAL_CHANNEL, analogRead(SENSOR_PIN));
}