New to Cayenne and the ESP8266 and having a very basic problem learning about “digital in” on a HUZZAH ESP8266. The following code is the only thing I could find. A display shows up on the dashboard but doesn’t reflect the actual status of the 8266 pin 5. Watched the videos, searched for hours but still having a hard time understanding the relationship of the virtual and physical pins on the 8266 and how to make it work. Any help clarifying whats going on here would be appreciated.
The usual login stuff here-----------------------------:
#define SENSOR_PIN 5 // Do not use digital pins 0 or 1 since those conflict with the use of Serial.
#define VIRTUAL_CHANNEL 3
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, digitalRead(SENSOR_PIN));
}