   Serial.print("list size: ");
   Serial.println(status*list_size);
   
+  if(list_size == 0){
+    Serial.println("Calibration failed.");
+    Serial.println(Pozyx.getSystemError());
+    return;
+  }
+  
   uint16_t device_ids[list_size];
   status &= Pozyx.getDeviceIds(device_ids,list_size);
   

#include <Pozyx.h>
#include <Pozyx_definitions.h>
#include <Wire.h>

  // clear all previous devices in the device list
  Pozyx.clearDevices();
     
  int status = Pozyx.doAnchorCalibration(POZYX_2_5D, 10, num_anchors, anchors, heights);
  if (status != POZYX_SUCCESS){
    Serial.println(status);
    Serial.println(F("ERROR: calibration"));
