 RadStorage radStorage(&rFram);
 
 Task countTask(&countFunc, countInterval, 0);
+Task advertisingTask(&enableAdvertising, advertisingInterval, 1);
 
 
 volatile bool radFlag = 0;

  //TODO Power Manegment

  scheduler.addEvent(&countTask);
}


void setup() {

  begin();
  delay(5000);
  blinkBean();

  countTask.enable();

  scheduler.run();
  delay(5);


}


void radEventRise() {
  stopRadSensor();
  pulseStart = micros();
  attachInterrupt(radSensor.getPin(), radEventFall, FALLING);


}

void radEventFall() {
  stopRadSensor();
  if(micros() - pulseStart >= pulseWidth){
      radFlag = 1;
      radCnt++;
  }
  attachInterrupt(radSensor.getPin(), radEventRise, RISING);


}


void countFunc() {

  countTask.disable();
  stopRadSensor();
  DateTime temp = rtc.now();
