   Serial.print("SCallback: TaskID=");
   Serial.println(i);
   Serial.print("Emulating measurement. d=");
-  
+
   d[i] = random(501); // pick a value from 0 to 500 "centimeters" simulating a measurement
   int *pd = (int*) t.getLtsPointer();
   *pd = d[i];
-  
+
   measure.signal();
 
   Serial.print(d[i]);


  Serial.begin(115200);
  Serial.println("TaskScheduler StatusRequest Sensor Emulation Test. Complex Test.");
  randomSeed(analogRead(A1) + millis());

  tSensor1.setLtsPointer(&d_lts[0]);
  tSensor2.setLtsPointer(&d_lts[1]);
  tSensor3.setLtsPointer(&d_lts[2]);

  tCalculate.setTimeout(1 * TASK_SECOND);

  tCycle.enable();
}


Task tSensor2(0, TASK_ONCE, &SCallback, &ts, false, &SEnable); // task ID = 2
Task tSensor3(0, TASK_ONCE, &SCallback, &ts, false, &SEnable); // task ID = 3

Task tCycle(10000, TASK_FOREVER, &CycleCallback, &hts);
Task tCalculate(TASK_IMMEDIATE , TASK_ONCE, &CalcCallback, &hts, false, &CalcEnable, &CalcDisable);

#define NO_OF_SENSORS 3
long distance, d[NO_OF_SENSORS + 1], d_lts[NO_OF_SENSORS]; // d[] will be populated via task ID used as array indexes, d_lts will be addressed via LTS pointers

void CycleCallback() {
  Serial.println();
  Serial.print(millis()); Serial.print(":\t");
  Serial.println("CycleCallback: Initiating measurement cycle every 10 seconds");

