Go Down

Topic: Problem with ADNS 9800 to get travel distance (Read 326 times) previous topic - next topic

sephir29

I just got this ADNS 9800 component and I was trying to get travel distance with the arduino:

https://www.tindie.com/products/jkicklighter/adns-9800-laser-motion-sensor/


I've cut the 3.3V pad and solder the 5V one

and I've used this code:
https://github.com/mrjohnk/ADNS-9800/tree/master/Arduino%20Example%20Sketches

I just had to change in the firmware
prog_uchar firmware_data[] PROGMEM =
To:
const char firmware_data[] PROGMEM =

and in the sketch I had to change
extern const unsigned char firmware_data[];
to
extern const char firmware_data[];


My issue it that the code seems to work but in the debug I only get -1 for x and Y

did someone ever use this component ??
or is there a trick I haven't seen?

I've attacheb my debug file and a picture of how I cable the ADNS with arduino



PaulS

#1
Jan 15, 2018, 12:11 pm Last Edit: Jan 15, 2018, 12:12 pm by PaulS
Quote
I just had to change in the firmware
prog_uchar firmware_data[] PROGMEM =
To:
const char firmware_data[] PROGMEM =
Why did you change from unsigned char to signed char?

Quote
and a picture of how I cable the ADNS with arduino
There is something missing from your picture. Two things, actually.

First, the Arduino is conspicuously missing, so we can't tell which Arduino you have connected the device to.

Second, none of the 8 wires shown appear to actually be soldered to the board.
The art of getting good answers lies in asking good questions.

sephir29

Hi,
I'm using an arduino UNO
the wire are all connected correctly to the board asI wrote on the image
U right, yeah I did a mistake to change an unsigned to a signed I changed it back in the script but I still have the same result



PaulS

Quote
the wire are all connected correctly to the board asI wrote on the image
"Put in the right holes" and "connected correctly" are NOT the same thing.

Are the wires soldered to the adns-9800? They do not appear to be.
The art of getting good answers lies in asking good questions.

sephir29

Oki I m going to solder the wire as you advice and I ll post back after :) thanks

sephir29

Hello,
you were right it works now that I've solder the wire to the ADNS !!!
thanks a lot,
I got another question now, do you think I can plug 2 ADNS 9800 to one arduino UNo?

my basic idea is that with 1 ADNS9800 I got have the relative position movement, but if I have 2 I could also have the relative rotation - By substracting the vector position of each ADNS this will give me the orientation vector between the 2 ADNS

let me know your thought :)


PaulS

I got another question now, do you think I can plug 2 ADNS 9800 to one arduino UNo?
Quote
Features:
    Works with Arduino SPI library
So, as long as you use a different Slave Select (sometimes called chip select) pin for each device, you can connect as many as you have pins, and read them all independently.
The art of getting good answers lies in asking good questions.

Go Up