I’m more comfortable reading a python script as opposed to cpp. So when I got this error I had no idea what was wrong in the code.
The error says that “on” was not declared in the scope. How would you correct this code so it compiles without error?
CAYENNE_IN(1)
{
CAYENNE_LOG(“CAYENNE_IN_DEFAULT(%u) – %s, %s”, request.channel, getValue.getId(), getValue.asString());
if (request.channel = 1)
{
String value0;
value0 = (String)getValue.asString();
if (value0 == “1”)
{
digitalWrite(5, HIGH);
display.println(On);
display.display();
delay(10);
}
else
{
digitalWrite(5, LOW);
display.println(off);
display.display();
delay(10);
}
}
}