You could provide a Spark.function() that does the resetting.
And since such a function does have an int return value, you could even forget the Spark.varilble()
If you call the fn with an empty parameter you just use the return value and when providing a param (e.g. βresetβ) you do just this.
int count = 0;
void setup()
{
Spark.function("doIt", doIt);
pinMode(D0, INPUT_PULLUP); // if your button pulls to ground
}
void loop()
{
if(digitalRead(D0) == HIGH){
count++;
delay(500);
//status = count;
}
}
int doIt(String param)
{
if (param == "reset")
count = 0;
return count;
}