Code-stuff

This commit is contained in:
sicarius 2007-02-19 20:57:03 +00:00
parent b3196682b1
commit 42a38959ff
12 changed files with 474 additions and 55 deletions

View file

@ -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()

View file

@ -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();
}