ADNS2620 Problem

I purchased the breakout for ADNS2620 Optical Mouse Sensor. I removed the kapton tape on the sensor.

I am using an Adruino Duemilanove (ATMEGA328). I hooked up the 4 wires as follows: GND to GND, VCC to 5V, SDIO to Analog 4, SCL to Analog 5.

I downloaded ADNS2620 Arduino Library from (http://www.sparkfun.com/products/10105), compiled and ran the example, but I keep getting:

x:FF y:FF

If the below connections image is not showing, go here:
Imgur

Here is the code used:

/* ADNS2620 Example Sketch

  • Demonstrates how to use the ADNS2620 Library to interface with the mouse sensor
  • on the ADNS2620 evaluation board from SparkFun Electronics
  • More register definitions are located in the ‘adns2620.h’ file. Read the
  • ADNS2620 datasheet to understand how to use the registers.
  • After loading the sketch to the ADNS2620 evaluation board, open the serial terminal
  • using a baud rate of 9600 to see the output from the ADNS2620 sensor.
  • Written by Ryan Owens
  • 11/4/10
  • SparkFun Electronics
    */
    //Add the ADNS2620 Library to the sketch.
    #include <adns2620.h>

//Name the ADNS2620, and tell the sketch which pins are used for communication
ADNS2620 mouse(4,5);

//This value will be used to store information from the mouse registers.
unsigned char value=0;

void setup()
{
//Initialize the ADNS2620
mouse.begin();
delay(100);
//A sync is performed to make sure the ADNS2620 is communicating
mouse.sync();
//Put the ADNS2620 into ‘always on’ mode.
mouse.write(CONFIGURATION_REG, 0x01);

//Create a serial output.
Serial.begin(9600);
}

void loop()
{
//The DELTA_X_REG and DELTA_Y_REG store the x and y movements detected by the sensor

//Read the DELTA_X_REG register and store the result in ‘value’
value = mouse.read(DELTA_X_REG);
//Print ‘value’ to the serial port.
Serial.print(“X:”);
Serial.print(value, HEX);
Serial.print(’\t’);

//Read the DELTA_Y_REG register and store the result in ‘value’
value = mouse.read(DELTA_Y_REG);
//Print ‘value’ to the serial port.
Serial.print(“Y:”);
Serial.println(value, HEX);

delay(10);
}

SDIO to Analog 3, SCL to Analog 4.

On Sparkfun's site you said you used Analog 4 and 5 (which would be correct for I2C). Here you say you are using 3 and 4. Which is it?

I am using Analog 4 & 5

Pull up resistors?

ADNS2620 mouse(4,5)

The example code used pins "18" and "19" for a reason. 18 is A4 and 19 is A5.

So you need to either state "A4, A5" there or you need to state "18,19." You have, likely, told the library to use digital pins 4 and 5, which won't work.

You are correct James. I completely forgot! 18,19 fixed it!

Thank you!