             if (aryInvalidDataFlag[ix] == 0)
               processSignalStrength(ix);
           }
-          if (xv_config.show_dist) {                       // the 'ShowDistance' command is active
-            if (xv_config.show_angle == SHOW_ALL_ANGLES    // Are we showing all angles or just 1 angle?
-            || ((xv_config.show_angle >= startingAngle) && (xv_config.show_angle < startingAngle + N_DATA_QUADS))) {
-              for (int ix = 0; ix < N_DATA_QUADS; ix++) {  // process each of the (4) angles
-                if ((xv_config.show_angle == SHOW_ALL_ANGLES) || (xv_config.show_angle == startingAngle + ix)) {
-                  if (aryInvalidDataFlag[ix] == 0) {       // make sure that the 'Invalid Data' flag is clear                                       
+          if (xv_config.show_dist) {                         // the 'ShowDistance' command is active
+            if (bShowAnglesFromArray) {                      // we're going to display only angles that are in 'aryAngles'
+              for (int ix = 0; ix < N_DATA_QUADS; ix++) {
+                if (aryAngles[startingAngle + ix]) {         // if we're supposed to display that angle
+                  if (aryInvalidDataFlag[ix] == 0) {         // make sure that the 'Invalid Data' flag is clear                                                           
+                    Serial.print(startingAngle + ix);
+                    Serial.print(F(","));
+                    Serial.println(int(aryDist[ix]));
+                    //Serial.print(F(" ("));
+                    //Serial.print(aryQuality[ix]);
+                    //Serial.println(F(")")); 
+                  }
+                  else if (bShowErrors) {
+                    /*
                     Serial.print(startingAngle + ix);
                     Serial.print(F(": "));
-                    Serial.print(int(aryDist[ix]));
-                    Serial.print(F(" ("));
-                    Serial.print(aryQuality[ix]);
-                    Serial.println(F(")")); 
-                  }
-                  else {                    
-                    /* // UNCOMMENT BELOW TO PRINT 'INVALID' and 'SIGNAL' ERROR MESSAGES IN REAL-TIME
-                    Serial.print(startingAngle + ix);
-                    Serial.print(F(": "));
-                    for (int ix = 0; ix < PACKET_LENGTH; ix++) {
-                      if (Packet[ix] < 0x10)
-                        Serial.print("0");
-                      Serial.print(Packet[ix], HEX);
-                      Serial.print(" ");
+                    for (int jx = 0; jx < PACKET_LENGTH; jx++) {
+                      if (Packet[jx] < 0x10)
+                        Serial.print(F("0"));
+                      Serial.print(Packet[jx], HEX);
+                      Serial.print(F(" "));
                     }
-                    for (int ix = 0; ix < N_DATA_QUADS; ix++) {
+                    */
+                    if (aryInvalidDataFlag[ix] & INVALID_DATA_FLAG)
+                      Serial.print(F("{I}"));
+                    if (aryInvalidDataFlag[ix] & STRENGTH_WARNING_FLAG) 
+                      Serial.print(F("{S}"));
+                    if (aryInvalidDataFlag[ix])
+                      Serial.println(F(""));                      
+                  }  // else if (bShowErrors)
+                }  // if (aryAngles[startingAngle + ix])
+              }  // for (int ix = 0; ix < N_DATA_QUADS; ix++)
+            }  // if (bShowAnglesFromArray)
+            else {
+              if (xv_config.show_angle == SHOW_ALL_ANGLES    // Are we showing all angles or just 1 angle?
+              || ((xv_config.show_angle >= startingAngle) && (xv_config.show_angle < startingAngle + N_DATA_QUADS))) {
+                for (int ix = 0; ix < N_DATA_QUADS; ix++) {  // process each of the (4) angles
+                  if ((xv_config.show_angle == SHOW_ALL_ANGLES) || (xv_config.show_angle == startingAngle + ix)) {
+                    if (aryInvalidDataFlag[ix] == 0) {       // make sure that the 'Invalid Data' flag is clear                                                             
+                      Serial.print(startingAngle + ix);
+                      Serial.print(F(","));
+                      Serial.println(int(aryDist[ix]));
+                      //Serial.print(F(" ("));
+                      //Serial.print(aryQuality[ix]);
+                      //Serial.println(F(")")); 
+                    }
+                    else if (bShowErrors) {
+                      /*
+                      Serial.print(startingAngle + ix);
+                      Serial.print(F(": "));
+                      for (int jx = 0; jx < PACKET_LENGTH; jx++) {
+                        if (Packet[jx] < 0x10)
+                          Serial.print(F("0"));
+                        Serial.print(Packet[jx], HEX);
+                        Serial.print(F(" "));
+                      }
+                      */
                       if (aryInvalidDataFlag[ix] & INVALID_DATA_FLAG)
-                        Serial.print("{I}");
-                      else
-                        Serial.print("{_}");
-                    }
-                    for (int ix = 0; ix < N_DATA_QUADS; ix++) {
+                        Serial.print(F("{I}"));
                       if (aryInvalidDataFlag[ix] & STRENGTH_WARNING_FLAG) 
-                        Serial.print("{S}");
-                      else
-                        Serial.print("{_}");
-                    }                    
-                    Serial.println("");
-                    */ // UNCOMMENT ABOVE
-                  }  // else
-                }  // if ((xv_config.show_angle == SHOW_ALL_ANGLES) ...
-              }  // or (int ix = 0; ix < N_DATA_QUADS; ix++)
-            }  // if (xv_config.show_angle == SHOW_ALL_ANGLES ...
+                        Serial.print(F("{S}"));
+                      if (aryInvalidDataFlag[ix])
+                        Serial.println(F(""));                      
+                    }  // else if (bShowErrors)
+                  }  // if ((xv_config.show_angle == SHOW_ALL_ANGLES) ...
+                }  // or (int ix = 0; ix < N_DATA_QUADS; ix++)
+              }  // if (xv_config.show_angle == SHOW_ALL_ANGLES ...
+            }  // if (bShowAngles)            
           }  // if (xv_config.show_dist)
         }  // if (eValidatePacket() == 0
-        else {
-          //Serial.println("Skipping packet with bad CRC");          
+        else if (bShowErrors) {
+          /*
+          for (int ix = 0; ix < PACKET_LENGTH; ix++) {
+            if (Packet[ix] < 0x10)
+              Serial.print(F("0"));
+            Serial.print(Packet[ix], HEX);
+            Serial.print(F(" "));
+          }
+          Serial.println(F(" Bad CRC"));
+          */
+          Serial.println(F("C"));
         }
         // initialize a bunch of stuff before we switch back to State 1
         for (int ix = 0; ix < N_DATA_QUADS; ix++) {

}

void showAngle() {
  showDist(); 
  double sVal = 0.0;
  char *arg;

 http://www.getsurreal.com/products/xv-lidar-controller
 
 Modified to add CRC checking - Doug Hilton, WD0UG November, 2015 mailto: six.speed (at) yahoo (dot) com
 Modified to add ShowErrors / HideErrors - DSH
 Modified to add ShowAngles - DSH
 Modified SerialCommand.h to increase # of characters allowed to be input and command length - DSH
           #define SERIALCOMMAND_BUFFER 100		// ORIGINAL: 32   MODIFIED BY DSH
           #define SERIALCOMMAND_MAXCOMMANDLENGTH 20	// ORIGINAL: 8
 ****************************************************************************************
 NOTE: DON'T FORGET TO COPY THE NEW SerialCommand.h TO YOUR ARDUINO LIBRARY DIRECTORY!!!
 ****************************************************************************************
 See README for additional information 
 
 The F() macro in the Serial statements tells the compiler to keep your strings in PROGMEM
