 
       inString = "";
 
-    }
-  }
-
-  if (completo == 5) {
-    for (int i=0; i<5; i++) {
-      Serial2.print(dataOut[i]);
-    }
-    Serial2.print(666);
-    completo = 0;
-  }
-  if (completo == 6) {
-    Serial2.print(dataOut[0]);
-    completo = 0;
-  }
-
+    } //chiudo if inChar == '\n'
+
+  } // chiudo if serial available
 }

      switch (tag) {
        case 'a':   //pos A
          dataOut[completo] = dataIn * (100800 / 360) + 500000;
          Serial.println(tag);

          Serial.print(dataIn);
          Serial.print(" // ");
          Serial.print(dataOut[completo]);
          Serial.print(" // ");
          Serial.println(completo);
          
          completo++;
          break;
        case 'A':

            dataOut[completo] = dataIn * (100800 / 360) + 20500000;
          }
          Serial.print(tag);
          Serial.print(dataIn);
          Serial.print(" // ");
          Serial.println(dataOut[completo]);
          completo++;
          break;
        case 's':
          dataOut[completo] = 15500000;
          Serial.print("Stop // ");
          Serial.println(dataOut[completo]);
          Serial2.print(dataOut[completo]);
          completo++;
          break;
        case 'z':
          Serial.println("z");
          Serial.println(dataOut[completo]);
          switch (dataIn) {
            case 1:
              Serial.print("zerosA // ");
              Serial.println(4500000);
              break;
            case 2:
              Serial.print("zerosB // ");
              Serial.println(5500000);
              break;
            case 3:
              Serial.print("zerosC // ");
              Serial.println(12500000);
              break;
            case 4:
              Serial.print("zerosD // ");
              Serial.println(13500000);
              break;
            case 5:
              Serial.print("zerosE // ");
              Serial.println(14500000);
              break;
            default:
              Serial.println("motore non esistente");
              break;
          completo++;
          }
          break;
        case 'g':
          for (uint8_t i = 0; i<completo; i++) {
            Serial.println(dataOut[completo]);
            Serial2.print(dataOut[completo]);
          }

        default:
          Serial.println("comando inesistente");
          break;
