     }
   }
 }
+
+void galoppo(float v) {
+  bool fine=false;
+  long ii = millis();
+  while (!fine) {
+    digitalWrite(zampaPS,HIGH);
+    if ((millis() - ii) > (300*v) {
+      digitalWrite(zampaPS,LOW);
+    } 
+
+    if ((millis() - ii) > (75*v)) {
+      digitalWrite(zampaPD,HIGH);
+    }
+    if ((millis() - ii) > (375*v)) {
+      digitalWrite(zampaPD,LOW);
+    }
+
+    if ((millis() - ii) > (150*v)) {
+      digitalWrite(zampaAS,HIGH);
+    }
+    if ((millis() - ii) > (450*v)) {
+      digitalWrite(zampaAS,HIGH);
+    }
+
+    if ((millis() - ii) > (225*v)) {
+      digitalWrite(zampaAD,HIGH);
+    }
+    if ((millis() - ii) > (525*v)) {
+      digitalWrite(zampaAD,HIGH);
+    }
+
+    
+
+    digitalWrite(zampaAD,HIGH);
+  }
+}

long t6 = 0;

int tempo = 0;

void setup() {
  delay(1000);

    char c = keyboard.read();

    if (c == '1') {
      galoppo(w);
    } 
    else if (c == 'p') {
      digitalWrite(piede,HIGH);
      t5 = millis();
    } 
    else if (c == 't') {
      digitalWrite(tamburo,HIGH);
      t6 = millis();
    }
       
  }

  else {
    if ((millis() - t5) > tempo) {
      digitalWrite(piede,LOW);
    }
    if ((millis() - t5) > tempo) {
      digitalWrite(piede,LOW);
