 void start();
 void enroll(Command cmd, uint32_t param);
 //Utility functions
+void toggle();
 void flash(uint32_t num,int time);
 //Error leaf function
 void error(uint32_t error);

  uint32_t param = packet->param;
  uint16_t cmd = packet->cmd;
  free(packet);
  //if (cmd == NAK)
  //  error(param);
  return param;
}
/**

  free(led);
}
/**
 * Toggle the light.
 */
void toggle() {
  static uint8_t out = 0;
  out = (out == 0) ? 99 : out - 33; 
  analogWrite(PWM_PIN,(((uint16_t)out)*256)/100);
}

/**
 * Loops waiting for finger print.
 */
void loop()
{
  CommandPacket* led = getCommand(CMOS_LED);
  setParameter(led,1);
  sendCommand(led);
  CommandPacket* finger = getCommand(IS_PRESS_FINGER);
  while (sendCommand(finger) != 0) {}
  free(finger);
  CommandPacket* id = getCommand(IDENTIFY);
  if(sendCommand(id) < 199) {
    toggle();
    setParameter(led,0);
    sendCommand(led);
    delay(500);
  }
  free(id);
  free(led);
