         interrupt2Count--;
     }
 }
-
-
 
 
 void SetMotor(int id, int speed)

    }
}

void EncoderRotationCount2() {
    if(motorDirectionIsForward2)
    {
        interrupt2Count++;




void loop() 
{
    SendWheelData();

    String data;
    if (Serial.available() > 0) { 
      //Serial.read();
      data = Serial.readString();

      int splitPos = data.indexOf('|');

      String serialPart1 = data.substring(0, splitPos);
      String serialPart2 = data.substring(splitPos+1);
      
      char buffer[10];
      serialPart1.toCharArray(buffer, 10);
      float firstValue = atof(buffer);
      
      serialPart2.toCharArray(buffer, 10);
      float secondValue = atof(buffer);

      SetMotor(1, firstValue);
      SetMotor(2, secondValue);

      motorTimestamp = millis();
    }

    if(motorTimestamp + motorTimeout < millis())
    {
      SetMotor(1, 0);
      SetMotor(2, 0);
    }
    
}

