Advertisement
Guest User

Untitled

a guest
Dec 28th, 2014
60
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "SparkButton/SparkButton.h"
  2.  
  3. SparkButton b = SparkButton();
  4.  
  5. bool rainbow_mode = false;
  6.  
  7. void setup() {
  8.     // initialize Spark button
  9.     b.begin();
  10.    
  11.     // register led control function
  12.    Spark.function("led", ledControl);
  13. }
  14.  
  15. void loop() {
  16.  
  17. }
  18.  
  19. int ledControl(String command) {
  20.    b.rainbow(2);
  21.    delay(500);
  22.    b.allLedsOff();
  23. }
Advertisement
RAW Paste Data Copied
Advertisement