Value keeps incrementing even though loop has terminated, why?
Here:
void awakeLoop(){  
  double delta;
  // The rest of the function body...
  delta = 0;
}

delta is being defined as a variable local to the function awakeLoop()
and with automatic storage. This means the variable is created whenever
the program enters the function, is not implicitly initialized, and is
destroyed when the function returns.
The last statement delta = 0; has no effect, as it is setting a
variable that is going to be destroyed right away. The compiler most
likely got rid of it.
You most likely want the variable to retain its value across invocations
of the function. For this to be the case, it has to be either global
(defined outside the function) or local with the static qualifier. In
both cases, it will have static storage, i.e. its lifetime will be the
whole program run. Also, if you fail to explicitly initialize it, the
compiler will implicitly initialize it to zero.