   unsigned long startTime = millis();
   for(unsigned long i = 0; i < delayVal; i++){
     while(millis() - startTime < 1000){
-      heartBeat(millis(), 10000);
+      heartBeat(10000);
 
       if(!mSwitch.switchState()){ //return if switch is turned off. Main program waits for restart.
         return;


void heartBeat(unsigned long mSeconds, int hbInterval){
  static unsigned long oldTime;
  if(mSeconds - oldTime > hbInterval){


    mSwitch.heartBeat(1);

//                           |  \/
  lmShake.addLinkToBack( 2, 30, 0 ); // Shake

  randomSeed(analogRead(5));

  mSwitch.heartBeat(3);
