Advertisement
Guest User

Untitled

a guest
Jul 24th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. /**
  2. * SerialIndex, send int example A
  3. * In this example variable var1 is added to SerialIndex and
  4. * is monitored for changes over time. the value of var1 is
  5. * continuously increasing and you will see the current state
  6. * inside the Serial Monitor when active.
  7. * To make changes to var1, use the Serial Monitor's send option
  8. * and type (make sure the line ending is set to 'Both NL & CR'):
  9. * var1=0
  10. * this will reset the value of var1 to 0.
  11. */
  12. #include <SerialIndex.h>
  13.  
  14. int var1 = 500;
  15.  
  16. void setup() {
  17. Index.begin(9600);
  18. Index.read(true);
  19. Index.add("var1", var1);
  20. }
  21.  
  22. void loop() {
  23.  
  24. var1++;
  25.  
  26. // update SerialIndex
  27. Index.update();
  28.  
  29. // add some delay-time
  30. delay(100);
  31.  
  32. Serial.println(var1);
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement