+++ Codework, Navigator&Positiontracker done (buggy?)
This commit is contained in:
parent
ec2a18e931
commit
22433e52a7
9 changed files with 168 additions and 46 deletions
|
@ -24,6 +24,8 @@ public:
|
|||
this->configReset = 0;
|
||||
this->configAwake = 0;
|
||||
this->newImage = false;
|
||||
this->positionX = 0;
|
||||
this->positionY = 0;
|
||||
}
|
||||
|
||||
Mouse_Sensor(uint32 sensorId)
|
||||
|
@ -47,6 +49,8 @@ public:
|
|||
this->registerDeltaY = 0x02;
|
||||
this->configReset = 0x80;
|
||||
this->configAwake = 0x01;
|
||||
this->positionX = -3.88f * TICKS_PER_CM;
|
||||
this->positionY = -3.88f * TICKS_PER_CM;
|
||||
break;
|
||||
case IO_SENSOR_MOUSE_RIGHT:
|
||||
this->hardwarePort = &PORTC;
|
||||
|
@ -61,6 +65,8 @@ public:
|
|||
this->registerDeltaY = 0x02;
|
||||
this->configReset = 0x80;
|
||||
this->configAwake = 0x01;
|
||||
this->positionX = -3.88f * TICKS_PER_CM;
|
||||
this->positionY = 3.88f * TICKS_PER_CM;
|
||||
break;
|
||||
default:
|
||||
this->hardwarePort = NULL;
|
||||
|
@ -101,8 +107,10 @@ protected:
|
|||
uint8 registerDeltaY;
|
||||
uint8 configReset;
|
||||
uint8 configAwake;
|
||||
//Information
|
||||
float positionX;
|
||||
float positionY;
|
||||
|
||||
public:
|
||||
void WriteByte(uint8 newByte)
|
||||
{
|
||||
*hardwareDDR |= pinSDA;//Set SDA output
|
||||
|
@ -180,6 +188,8 @@ public:
|
|||
return pixel;
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
uint8 GetSqual()
|
||||
{
|
||||
return Read(registerSqual);
|
||||
|
@ -194,6 +204,16 @@ public:
|
|||
{
|
||||
return (int8)(Read(registerDeltaY));
|
||||
}
|
||||
|
||||
float GetPositionX()
|
||||
{
|
||||
return positionX;
|
||||
}
|
||||
|
||||
float GetPositionY()
|
||||
{
|
||||
return positionY;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Reference in a new issue