Advertisement
Guest User

Untitled

a guest
Dec 14th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. /*
  2. Cayenne Ethernet Example
  3.  
  4. This sketch connects to the Cayenne server using an Arduino Ethernet Shield W5100
  5. and runs the main communication loop.
  6.  
  7. The Cayenne Library is required to run this sketch. If you have not already done so you can install it from the Arduino IDE Library Manager.
  8.  
  9. Steps:
  10. 1. Set the token variable to match the Arduino token from the Dashboard.
  11. 2. Compile and upload this sketch.
  12.  
  13. For Cayenne Dashboard widgets using digital or analog pins this sketch will automatically
  14. send data on those pins to the Cayenne server. If the widgets use Virtual Pins, data
  15. should be sent to those pins using virtualWrites. Examples for sending and receiving
  16. Virtual Pin data are under the Basics folder.
  17. */
  18.  
  19. //#define CAYENNE_DEBUG // Uncomment to show debug messages
  20. #define CAYENNE_PRINT Serial // Comment this out to disable prints and save space
  21. #include <CayenneEthernet.h>
  22.  
  23. // Cayenne authentication token. This should be obtained from the Cayenne Dashboard.
  24. char token[] = "AQUI SEU TOKEN";
  25.  
  26. void setup()
  27. {
  28. Serial.begin(9600);
  29. Cayenne.begin(token);
  30. }
  31.  
  32. void loop()
  33. {
  34. Cayenne.run();
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement