Arduino Mega und optische Maus

Hallo zusammen,
auch mit eurer Hilfe, bin ich mit meinem ersten Projekt, einem Experimentierbot, schon recht weit gekommen. Nun möchte ich zur Positionsbestimmung zusätzlich eine optische Maus verwenden. Bei meinen Recherchen bin ich auf diesen tollen Link von Martijn gestoßen:
http://www.martijnthe.nl/2009/07/interfacing-an-optical-mouse-sensor-to-your-arduino/
Hier wird zwar auf die Arduinoversion 0010 bzw. 0012 verwiesen, aber ich denke, das geht auch mit der aktuellen Version 0022. Ich habe also die Startdatei einsprechend meiner Maus umgeschrieben.

#include "WProgram.h"
// #include "PAN3101.h"
   #include "ADNS2051.h"
// #include "ADNS2610.h"
// #include "ADNS2083.h"

#define SCLK 2                            // Serial clock pin on the Arduino
#define SDIO 3                            // Serial data (I/O) pin on the Arduino

// PAN3101 Optical1 = PAN3101(SCLK, SDIO);   // Create an instance of the PAN3101 object
   ADNS2051 Optical1 = ADNS2051(SCLK, SDIO);
// ADNS2610 Optical1 = ADNS2610(SCLK, SDIO);
// ADNS2083 Optical1 = ADNS2083(SCLK, SDIO);

signed long x = 0;                        // Variables for our 'cursor'
signed long y = 0;                        //

int c = 0;                                // Counter variable for coordinate reporting

//------------------ End of deklarations --------------------------------------
  extern "C" {
    void __cxa_pure_virtual()
    {
      // put error handling here
    }
  }
// -------------------------------- setup -------------------------------------
 void setup()
  {
    Serial.begin(38400);
    Optical1.begin();                       // Resync (not really necessary?)
  }
//------------------------------- Loop ----------------------------------------
  void loop()
  {
  //  The status commands are available only for the PAN3101 and the ADNS2051:
    Optical1.updateStatus();                // Get the latest motion status
    if (Optical1.motion())                  // If the 'Motion' status bit is set,
    {
      x += Optical1.dx();                   // Read the dX register and in/decrease X with that value
      y += Optical1.dy();                   // Same thing for dY register.....
    }
    if (c++ & 0x80)
    {                                       // Report the coordinates once in a while...
      Serial.print("x=");
      Serial.print(x, DEC);
      Serial.print(" y=");
      Serial.print(y, DEC);
      Serial.println();
      c = 0;                                // Reset the report counter
    }
  }
//-------------------------------- main ---------------------------------------
  int main(void) {
    /* Must call init for arduino to work properly */
    init();
    setup();

    for (;;) {
  	  loop();
    } // end for
  } // end main
//------------------------- End of program ------------------------------------

Nun bekomme ich diese Fehlermeldung:
In file included from ../WProgram.h:6,
from ../OptiMouse.h:26,
from ../ADNS2051.cpp:28:
c:/winavr/lib/gcc/../../avr/include/math.h:426: error: expected unqualified-id before 'double'
c:/winavr/lib/gcc/../../avr/include/math.h:426: error: expected )' before 'double'</sup> <sup>c:/winavr/lib/gcc/../../avr/include/math.h:426: error: expected )' before 'double'
make: *** [ADNS2051.o] Error 1

Da ich nicht glaube, dass jemand an Standartlibs „herumfummelt“, denke ich der Fehler liegt bei mir. Kann mir hier jemand helfen? Oder gibt es mittlerweile andere Möglichkeiten?
Gruß aus Leverkusen
Willi

OptiMouse-20093001.zip (28.7 KB)

Im Kleingedruckten steht

Update: the library is a bit outdated for the current Arduino versions. I am still providing the library as is, but I am not proving support for it anymore

Wird wohl nen bisschen Frickelei benötigen... Ist die Maus/deren Platine noch ganz? Warum schließt du sie nicht einfach über USB/PS2 an?

Wenn Du ihm erklärst wie man eine USB-Maus an Arduino anschließt, würde er sicher froh sein; das geht nämlich nicht so einfach, weil Arduino keinen Host-USB-Anschluß hat.
Grüße Uwe

Danke für die Antworten,
schade, ich dachte ich hätte hier eine einfache Lösung gefunden. Ich muss immer "rückwärts" lernen, nach dem Motte so ist das Ergebniss, warum ist das so?.javascript:void(0);

Habe hier Hilfe gefunden.
http://arduino.cc/forum/index.php/topic,63570.0.html
Die Fehlermeldungen sind weg. Leider ist das Ergebnis nicht das, was ich erhofft habe. Die Werte für die Koordinaten werden, selbst bei stillstehender Maus, einfach hochgezählt.
Willi