Umstellung der Abbremsung auf durchgängig float
This commit is contained in:
@@ -60,7 +60,7 @@ void Locomotive::Break()
|
||||
void Locomotive::setSpeed(byte Speed)
|
||||
{
|
||||
_currentSpeed = Speed;
|
||||
_motor.setSpeed(_currentSpeed);
|
||||
_motor.setSpeed( (int) (_currentSpeed+0.5));
|
||||
};
|
||||
|
||||
void Locomotive::setDirection(MotorDirection dir)
|
||||
@@ -76,7 +76,7 @@ void Locomotive::loop()
|
||||
currentMillis = millis();
|
||||
if (currentMillis - _millisStart >= _delay) //test whether the period has elapsed
|
||||
{
|
||||
byte newspeed;
|
||||
float newspeed;
|
||||
newspeed = _currentSpeed + _currentAcc;
|
||||
/* Serial.print("Locomotive.Loop: ");
|
||||
Serial.print(_currentSpeed);
|
||||
@@ -109,7 +109,7 @@ void Locomotive::loop()
|
||||
|
||||
byte Locomotive::currentSpeed()
|
||||
{
|
||||
return _currentSpeed;
|
||||
return ((byte) (_currentSpeed+0.5));
|
||||
};
|
||||
|
||||
byte Locomotive::getDefaultSpeed()
|
||||
|
||||
Reference in New Issue
Block a user