   Serial.println(); 
 }
 
+// function to print out positoining data + ranges for the processing sketch
+void printCoordinatesProcessing(coordinates_t coor){
+  
+  // get the network id and print it
+  uint16_t network_id;
+  Pozyx.getNetworkId(&network_id);
+  
+  Serial.print("POS,0x");
+  Serial.print(network_id,HEX);
+  Serial.print(",");
+  Serial.print(coor.x);
+  Serial.print(",");
+  Serial.print(coor.y);
+  Serial.print(",");
+  Serial.print(coor.z);
+  Serial.print(",");
+  
+  // get information about the positioning error and print it
+  pos_error_t pos_error;
+  Pozyx.getPositionError(&pos_error);
+    
+  Serial.print(pos_error.x);
+  Serial.print(",");
+  Serial.print(pos_error.y);
+  Serial.print(",");
+  Serial.print(pos_error.z);
+  Serial.print(",");
+  Serial.print(pos_error.xy);
+  Serial.print(",");
+  Serial.print(pos_error.xz);
+  Serial.print(",");
+  Serial.print(pos_error.yz); 
+  
+  // read out the ranges to each anchor and print it 
+  for (int i=0; i < num_anchors; i++){
+    device_range_t range;
+    Pozyx.getDeviceRangeInfo(anchors[i], &range);
+    Serial.print(",");
+    Serial.print(range.distance);  
+    Serial.print(",");
+    Serial.print(range.RSS); 
+  }
+  Serial.println();
+}
+
+// print out the anchor coordinates (also required for the processing sketch)
 void printCalibrationResult(){
   uint8_t list_size;
   int status;


void loop(){
  
  coordinates_t position;
  
  int status = Pozyx.doPositioning(&position, POZYX_2_5D, 1000);
  
  if (status == POZYX_SUCCESS){
    printCoordinates(position);
  }
}

void printCoordinates(coordinates_t coor){
  
  Serial.print("x_mm: ");

  Pozyx.clearDevices();
     
  int status = Pozyx.doAnchorCalibration(POZYX_2D, 10, num_anchors, anchors, heights);
  // if the automatic anchor calibration is unsuccessful, try manually setting the anchor coordinates
  // fot this, you must update the SetAnchorsManual function below
  // comment out the doAnchorCalibration if you are using manual mode
  //SetAnchorsManual();
  
  if (status != POZYX_SUCCESS){
    Serial.println(status);
