summaryrefslogtreecommitdiffstats
path: root/source/Concept/Framework/modules/output/engine.h
diff options
context:
space:
mode:
authorsicarius <devnull@localhost>2007-02-19 21:57:03 +0100
committersicarius <devnull@localhost>2007-02-19 21:57:03 +0100
commit42a38959ff5c097463c2c95d993e5934f100d223 (patch)
tree7ad00518e3fdd85a800f5c8bf48588e7f5e1a23a /source/Concept/Framework/modules/output/engine.h
parentb3196682b1d87c40156ed1b4092a7112dd0d80df (diff)
downloadrc2007-soccer-42a38959ff5c097463c2c95d993e5934f100d223.tar
rc2007-soccer-42a38959ff5c097463c2c95d993e5934f100d223.zip
Code-stuff
Diffstat (limited to 'source/Concept/Framework/modules/output/engine.h')
-rwxr-xr-xsource/Concept/Framework/modules/output/engine.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/source/Concept/Framework/modules/output/engine.h b/source/Concept/Framework/modules/output/engine.h
index 27b9905..7b7a044 100755
--- a/source/Concept/Framework/modules/output/engine.h
+++ b/source/Concept/Framework/modules/output/engine.h
@@ -58,7 +58,7 @@ public:
protected:
bool enabled;
- float curSpeed;
+ int curSpeed;
//Hardware
volatile uint8* hardwarePort;
@@ -94,16 +94,19 @@ protected:
}
public:
- float GetSpeed()
+ int GetSpeed()
{
return curSpeed;
}
- void SetSpeed(float newSpeed)
+ void SetSpeed(int newSpeed)
{
curSpeed = newSpeed;
- *pwmSpeed = (abs((int16)(newSpeed / SPEED_PER_PWM)));
+ int pwm = abs(newSpeed);
+ if(pwm > 255) pwm = 255;
+
+ *pwmSpeed = pwm;
UpdateDirection();
}