I am using Arduino Uno with W5100 ethernet shield
I am using the Web dashboard
When trying to activate a thermistor widget on a digital pin, the system gives 3 alternatives, virtual, analog and digital. It lets me choose digital pin, but when the script is produced it is for analog pin and not digital.
Here is part of the script:
Steps:
- In the Cayenne Dashboard add a new Thermistor widget.
- Set the widget to Value Display.
- Select Virtual Pins and a virtual pin number.
- Set VIRTUAL_PIN to the pin number you selected.
- Attach a thermistor to an analog pin on your Arduino. Make sure to use an analog pin, not a digital pin.
Schematic:
[Ground] – [10k-resistor] – | – [Thermistor] – [5V]
|
Analog Pin - Set the thermistorPin variable to match the pin used to connect the thermistor.
- Set the token variable to match the Arduino token from the Dashboard.
- Compile and upload this sketch.
- Once the Arduino connects to the Dashboard it should automatically update the Thermistor widget with data.
*/
#define CAYENNE_PRINT Serial // Comment this out to disable prints and save space
#include <CayenneTemperature.h>
// If you’re not using the Ethernet W5100 shield, change this to match your connection type. See Communications examples.
#include <CayenneEthernet.h>
// Cayenne authentication token. This should be obtained from the Cayenne Dashboard.
char token = “xxxxxxxxxx”;
// Virtual Pin of the Thermistor widget.
#define VIRTUAL_PIN V1
// Analog pin the thermistor is connected to.
const int thermistorPin = 0;
// Resistance of the resistor. Currently set to 10k but this can be set to the measured resistance of your
// resistor for greater accuracy.
const float resistance = 10000;
Thermistor thermistor(thermistorPin, resistance);
void setup()