Hello, im trying to measure voltage with an analogic pin, I modificated the code and i have this:
CAYENNE_OUT(VIRTUAL_CHANNEL4)
{
analogRead(SENSOR_PIN);
if(SENSOR_PIN == 0){
Cayenne.virtualWrite(VIRTUAL_CHANNEL4, "0");
}
if(SENSOR_PIN > 0){
Cayenne.virtualWrite(VIRTUAL_CHANNEL4, "1");
}
}
Cuz I wanna see a light icon if i have voltage and it works! But unfortunately when my arduino get refresh i get “0” again even if i have voltage yet, so the light icon get off
Could somebody help me?