/**
  * Spark Core source to go along with the 'Variables' example. To upload this
  * to your Spark Core, you can use the Build tool at https://spark.io/build, or
  * the Cylon command included with cylon-spark:
  *
  * $ cylon spark upload [access_token] [device_id] ./path/to/functions.cpp
  */

// for random number generation
#include <cstdlib>

// need this to use the Spark variable
#include "application.h"

int randomNumber = 4;

void setup()
{
    Spark.variable("randomNumber", &randomNumber, INT);
}

void loop()
{
    // gives us a random number between 1-100
    randomNumber = rand() % 100 + 1;
    delay(3000);
}
