Arduino Syntax for Virtuel Pins


#1

Hey

I need a 0-10Volt signal on my dashboard, via virtual pin V0. (it is connected to A0).
I’m having trouble writing the correct syntax in the arduino ide.
This is what I gor so far:

#define CAYENNE_PRINT Serial // Comment this out to disable prints and save space
#include <CayenneEthernet.h>
#define virtuel_co2 V0 //set output to Virtuel Pin V0

// Cayenne authentication token. This should be obtained from the Cayenne Dashboard.
char token[] = “zdq8qohh2j”;

void setup()
{
int co2in = analogRead(A0); // declare input
float virtuel_co2 = co2in * (2000.0 / 1023.0); //Calculation

Serial.begin(9600);

Cayenne.begin(token);

}

void loop()
{
Cayenne.run();
}


#2

Hello,
You can see the correct syntax here: http://mydevices.com/cayenne/docs/#sketch-files-virtual-pins