#define CAYENNE_PRINT Serial #include #define VIRTUAL_PIN1 V0 #define VIRTUAL_PIN2 V1 char token[] = "token"; float sensorValue1; float sensorValue2; void setup() { Serial.begin(9600); Cayenne.begin(token); } void loop() { Cayenne.run(); int analogValue1 = analogRead(A0); // read the input on analog pin 0 int analogValue2 = analogRead(A1); // read the input on analog pin 1 float a = 5; //I am measuring 25V on sensor, 25V/5V=5 float b = 0.00455522971; //Voltage on 5V pin on arduino / 1023, My voltage is 4.66V > 4.66/1023=0.00455522971 sensorValue1 = analogValue1 * a * b; sensorValue2 = analogValue2 * a * b; Serial.println(sensorValue1); Serial.println(sensorValue2); delay(500); //measuring every 0.5s } CAYENNE_OUT(VIRTUAL_PIN1) { Cayenne.virtualWrite(VIRTUAL_PIN1, sensorValue1); } CAYENNE_OUT(VIRTUAL_PIN2) { Cayenne.virtualWrite(VIRTUAL_PIN2, sensorValue2); }