From 42a38959ff5c097463c2c95d993e5934f100d223 Mon Sep 17 00:00:00 2001 From: sicarius Date: Mon, 19 Feb 2007 20:57:03 +0000 Subject: Code-stuff --- source/Concept/Framework/modules/output/display.h | 5 ++++- source/Concept/Framework/modules/output/engine.h | 11 +++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'source/Concept/Framework/modules/output') diff --git a/source/Concept/Framework/modules/output/display.h b/source/Concept/Framework/modules/output/display.h index e221120..bbfa292 100755 --- a/source/Concept/Framework/modules/output/display.h +++ b/source/Concept/Framework/modules/output/display.h @@ -39,7 +39,7 @@ public: this->settingIllumination = 76; this->settingCursorPosition = 79; msleep(100); - uart1_init(103);//9600 BAUD at 16MHz Atmel + uart1_init(51);//19200 BAUD at 16MHz Atmel msleep(100); break; default: @@ -52,6 +52,8 @@ public: this->settingCursorPosition = 0; break; } + + Clear(); } protected: @@ -137,6 +139,7 @@ public: void NewLine() { SendCommand(commandNewLine); + ReturnCursor(); } bool GetCursorVisible() 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(); } -- cgit v1.2.3