 OneButton buttonB(button_b, false);
 
 bool shouldSleep = false;
+
+bool gzllRunning = false;
+long gzllLastCommandTime = 0;
 
 void setup()
 {

  buttonB.attachDoubleClick(onDoubleClickB);
  buttonA.attachLongPressStop(onLongPressA);
  buttonB.attachLongPressStop(onLongPressB);

  // start the GZLL stack
  RFduinoGZLL.begin(role);

  resetAndSleep();
}


void sendToHost(int command)
{
  startGzll();
  RFduinoGZLL.sendToHost(command);
  // Serial.println("sent " + String(command));
  gzllLastCommandTime = millis();
  delay(10);
}

void startGzll()
{
  if(!gzllRunning){
    gzllRunning = true;
    RFduinoGZLL.begin(role);
  }
}

void stopGzll()
{
  if(gzllRunning){
    RFduinoGZLL.end();
    gzllRunning = false;  
  }
}

void tick()
