Code-stuff
This commit is contained in:
parent
b3196682b1
commit
42a38959ff
12 changed files with 474 additions and 55 deletions
|
@ -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()
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Reference in a new issue