 int act = 0;
 long att1 = 0;
 long att2 = 0;
-bool inviato = false;
+bool inviatoG = false;
+bool inviatop = false;
 
 void loop() {
   while (digitalRead(MAINSW)) //SHOW
   {
     if (act == 0) {
-      t0 = millis();
+      t0= millis();
       Serial.println("ACT 0");
-      inviato = false;
+      inviatop = false;
+      inviatoG = false;
       act++;
     }
-    show();
+    show_uno();
   }
   while (!digitalRead(MAINSW)) //TEST
   {
     act = 0;
+
     if (Serial.available() > 0) {
       Serial2.write(Serial.read());
     }
+
     if ((digitalRead(SEL_A) == 0) && (digitalRead(SEL_B) == 1)) //A
     {
       if (digitalRead(BT_A) == 0)  //premuto
       {
-        Serial.println("motore A orario");
-        ///////////////////////////
-        Serial2.print("P 3000");
-        Serial2.print('\r');
-        delay(100);
-        Serial2.print("p 10 0");
-        Serial2.print('\r');
-        delay(100);
-        Serial2.print("G 3000");
-        Serial2.print('\r');
-        delay(100);
-        Serial2.print("g 10 0 0");
-        Serial2.print('\r');
-        ////////////////////////////
+        if (digitalRead(SEL_Gp)) //1 è piccolo
+        {
+          Serial.println("motore A orario");
+          ///////////////////////////
+          Serial2.print("P 3000");
+          Serial2.print('\r');
+          delay(100);
+          Serial2.print("p 10 0");
+          Serial2.print('\r');
+        }
+        else
+        {
+          Serial.println("motore C orario");
+          Serial2.print("G 3000");
+          Serial2.print('\r');
+          delay(100);
+          Serial2.print("g 10 0 0");
+          Serial2.print('\r');
+          ////////////////////////////
+        }
         delay(1000);
       }
       else if (digitalRead(BT_B) == 1)  //premuto
       {
-        Serial.println("motore A/C antiorario");
-        ///////////////////////////
-        Serial2.print("P 3000");
-        Serial2.print('\r');
-        delay(100);
-        Serial2.print("p -10 0");
-        Serial2.print('\r');
-        delay(100);
-        Serial2.print("G 3000");
-        Serial2.print('\r');
-        delay(100);
-        Serial2.print("g -10 0 0");
-        Serial2.print('\r');
-        ////////////////////////////
+        if (digitalRead(SEL_Gp)) //1 è piccolo
+        {
+          Serial.println("motore A antiorario");
+          ///////////////////////////
+          Serial2.print("P 3000");
+          Serial2.print('\r');
+          delay(100);
+          Serial2.print("p -10 0");
+          Serial2.print('\r');
+        }
+        else
+        {
+          Serial.println("motore C antiorario");
+          Serial2.print("G 3000");
+          Serial2.print('\r');
+          delay(100);
+          Serial2.print("g -10 0 0");
+          Serial2.print('\r');
+          ////////////////////////////
+        }
         delay(1000);
       }
     }

    {
      if (digitalRead(BT_A) == 0)  //premuto
      {
        Serial.println("motore B/D orario");
        ///////////////////////////
        Serial2.print("P 3000");
        Serial2.print('\r');
        delay(100);
        Serial2.print("p 0 10");
        Serial2.print('\r');
        delay(100);
        Serial2.print("G 3000");
        Serial2.print('\r');
        delay(100);
        Serial2.print("g 0 -10 0");
        Serial2.print('\r');
        ////////////////////////////
        delay(1000);
      }
      else if (digitalRead(BT_B) == 1)  //premuto
      {
        Serial.println("motore B/D antiorario");
        ///////////////////////////
        Serial2.print("P 3000");
        Serial2.print('\r');
        delay(100);
        Serial2.print("p 0 -10");
        Serial2.print('\r');
        delay(100);
        Serial2.print("G 3000");
        Serial2.print('\r');
        delay(100);
        Serial2.print("g 0 10 0");
        Serial2.print('\r');
        ////////////////////////////
        delay(1000);
      }
    }

  else if (let == 'g') {
    char LET = 'G';

    payload = "";

    payload += LET;
    payload += " ";
    payload += String(vel);
    payload += '\r';

    Serial2.print(payload);

    payload = "";

