Author Topic: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]  (Read 76463 times)

0 Members and 1 Guest are viewing this topic.

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
:llama: http://www.kickstarter.com/projects/1034145369/high-speed-laser-optical-sensor :llama:

If you have an old trackball that needs a DPI boost, then you're in luck right now. The Avago ADNS-9800 is an 8200 DPI laser module that is used in a lot of high end gaming mice right now. It just has to be connected to a teensy to work. I plan to mod a Microsoft Trackball Optical with the one I ordered.
« Last Edit: Mon, 29 July 2013, 17:45:40 by The_Ed »
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline dorkvader

  • Posts: 6288
  • Location: Boston area
  • all about the "hack" in "geekhack"
:llama: http://www.kickstarter.com/projects/1034145369/high-speed-laser-optical-sensor :llama:

If you have an old trackball that needs a DPI boost, then you're in luck right now. The Avago ADNS-9800 is an 8200 DPI laser module that is used in a lot of high end gaming mice right now. It just has to be connected to a teensy to work. I plan to mod a Microsoft Trackball Optical with the one I ordered.
Excellent! I have a few opto-mechanical trackballs that I would like to modify like this.

Does Teensy code exist to control the sensor? I don't know any programming, so I fear making it myself will be beyond my skill.


Offline alaricljs

  • I be WOT'ing all day...
  • ** Moderator Emeritus
  • Posts: 3715
  • Location: NE US
As far as a I can tell there is an extremely simple Arduino sketch that can run on the teensy linked to from the page.
Filco w/ Imsto thick PBT
Ducky 1087XM PCB+Plate, w/ Matias "Quiet Click" spring-swapped w/ XM Greens

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
There is a test trackball code on github for it. I will have to modify it to have adjustable levels of DPI, and work with the other 4 mouse buttons. But first I'm gonna have to learn how to do that...
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline metalliqaz

  • * Maker
  • Posts: 4951
  • Location: the Making Stuff subforum
  • Leopold fanboy
Very interesting indeed.  Not sure what I would do with it, though

Offline alaricljs

  • I be WOT'ing all day...
  • ** Moderator Emeritus
  • Posts: 3715
  • Location: NE US
I use a TrackMan Marble... I would very much like to improve the tracking/DPI :)

Of course this basically means building a work-alike replacement, not just swapping in parts.
Filco w/ Imsto thick PBT
Ducky 1087XM PCB+Plate, w/ Matias "Quiet Click" spring-swapped w/ XM Greens

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
It should be just as easy as swapping the internals and programming it. Why would you have to build a "work-alike replacement"?
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline alaricljs

  • I be WOT'ing all day...
  • ** Moderator Emeritus
  • Posts: 3715
  • Location: NE US
I've been inside, there's not that much space for that sensor, it's bigger.  Then add in the teensy and what not.  Then also I could make the outer casing more comfy for my hand, another good excuse.
Filco w/ Imsto thick PBT
Ducky 1087XM PCB+Plate, w/ Matias "Quiet Click" spring-swapped w/ XM Greens

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
I may have to flatten some sides of the PCB to make it work in my Microsoft Trackball Optical (There shouldn't be any traces at the edge right?).
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline alaricljs

  • I be WOT'ing all day...
  • ** Moderator Emeritus
  • Posts: 3715
  • Location: NE US
You may be able to separate the sensor PCB from the round one he put together with the necessary caps and so forth.  I don't know how integral that is to the lens assembly.  That would shrink things down nicely in one dimension.  The pins on the sensor PCB can't be bent because they apparently have something to do with the lens assembly distance as far as I can tell.
Filco w/ Imsto thick PBT
Ducky 1087XM PCB+Plate, w/ Matias "Quiet Click" spring-swapped w/ XM Greens

Offline dorkvader

  • Posts: 6288
  • Location: Boston area
  • all about the "hack" in "geekhack"
fwiw, there's tons of room in all the ITAC trackballs I'm proxy-selling for another GH'er here.

The CST looks like it has plenty of room, too, though you'll have to mount the sensor sideways on a little stand, or cut a hole for it in the bottom of the casing. Either is a good solution for me.

I sort-of want to build a mouse out of this with a teensy, some hall effect switches, etc. (or cherry, if the HE proves to be too tall.)

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
I'm not really worried about it fitting, I'll just MAKE it fit. I'm worried about being able to modify that code to my needs. I've never coded for hardware before, just website languages and C++. That teensy code looks similar to C++, so I understand some of it at least.
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline dorkvader

  • Posts: 6288
  • Location: Boston area
  • all about the "hack" in "geekhack"
I'm not really worried about it fitting, I'll just MAKE it fit. I'm worried about being able to modify that code to my needs. I've never coded for hardware before, just website languages and C++. That teensy code looks similar to C++, so I understand some of it at least.

It's going to be you and I in this together. I dont' know any coding at all, but I'm happy to help test. I have a few trackballs I'd like to put this in, but there's one in particular that I think I will use (it also has lots of room underneath for a whole PCB.)

Do you think there's any way to combine the optical reading teensy code with a "small keyboard matrix" reading code? said trackball also has a tenkey on it, and I would love to get it working with one one USB device.

Anyway, I'll join this kickstarter once I have internet again and we can make a MST topic about the build process.

Offline metalliqaz

  • * Maker
  • Posts: 4951
  • Location: the Making Stuff subforum
  • Leopold fanboy

Do you think there's any way to combine the optical reading teensy code with a "small keyboard matrix" reading code? said trackball also has a tenkey on it, and I would love to get it working with one one USB device.


Absolutely.

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
The trackball motion, DPI stages (5-8 should be good), mouse buttons, and keyboard buttons should all be possible with the right code. Hell even macros and layers should be possible as well.

I will be using a teensy 3.0 to keep up with the times. Will you be using the 3.0 as well dorkvader?

It's good that I'm not gonna have to figure out the code alone. How many trackballs are you thinking of modding dorkvader?
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
It seems like I'm gonna have to contact Avago to get their C8051F347 Firmware... That way we will have a bunch of stuff coded already, and just have to change it to our needs. From the PDF's I can find it looks like it already has dpi and liftoff changing button code. Do you think they'll give it to me?
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline alaricljs

  • I be WOT'ing all day...
  • ** Moderator Emeritus
  • Posts: 3715
  • Location: NE US
Maybe ask John if he has it available?
Filco w/ Imsto thick PBT
Ducky 1087XM PCB+Plate, w/ Matias "Quiet Click" spring-swapped w/ XM Greens

Offline blueSmoke

  • Posts: 103
  • Location: Oakland, California
  • Life is what happens while you're busy Fixing RSI
Is this for a mouse? If so, hew do you reverse/switch the Y-axis for a trackball?

Software? Hardware?
Model M, Filco Tenkeyless White, Few others, few more others, Noise-hater (ongoing project), blah-blah (to be fillled later...)

Offline blueSmoke

  • Posts: 103
  • Location: Oakland, California
  • Life is what happens while you're busy Fixing RSI
Kickstarter? by John Kicklighter? is that a real name? interesting...

that rhymes.
Model M, Filco Tenkeyless White, Few others, few more others, Noise-hater (ongoing project), blah-blah (to be fillled later...)

Offline blueSmoke

  • Posts: 103
  • Location: Oakland, California
  • Life is what happens while you're busy Fixing RSI
Is this for a mouse? If so, hew do you reverse/switch the Y-axis for a trackball?

Software? Hardware?

Never mind. He shows a trackball in the demo. So it is possible. Only issue may be side mounting in trackballs that have large balls and need to be side mounted as well as the adjustment algorithm. We will see...
Model M, Filco Tenkeyless White, Few others, few more others, Noise-hater (ongoing project), blah-blah (to be fillled later...)

Offline alaricljs

  • I be WOT'ing all day...
  • ** Moderator Emeritus
  • Posts: 3715
  • Location: NE US
Avago's own docs say mouse/trackball.  Haven't even bothered figuring out how to switch the axis since the example was of a trackball, it can't be that hard.

ed: Time to reload tabs before I read them... going a little slow this late at night.
Filco w/ Imsto thick PBT
Ducky 1087XM PCB+Plate, w/ Matias "Quiet Click" spring-swapped w/ XM Greens

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
ed: Time to reload tabs before I read them... going a little slow this late at night.

What? I don't understand...
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline alaricljs

  • I be WOT'ing all day...
  • ** Moderator Emeritus
  • Posts: 3715
  • Location: NE US
late night lazy - ed == edit
Filco w/ Imsto thick PBT
Ducky 1087XM PCB+Plate, w/ Matias "Quiet Click" spring-swapped w/ XM Greens

Offline MrJohnK

  • Posts: 15
Flipping the axis (X or Y) is easy.  Just multiply the value retrieved from the SPI port by -1.  That is how I did it in the video.

-JK

Offline dorkvader

  • Posts: 6288
  • Location: Boston area
  • all about the "hack" in "geekhack"
Flipping the axis (X or Y) is easy.  Just multiply the value retrieved from the SPI port by -1.  That is how I did it in the video.

-JK

Welcome to geekhack and thanks for posting.  For what its worth I can't help code at all. I will buy whatever teensy works best for this and ill want to mod at least two trackballs with this. Maybe I'll get a good arcade trackball or a penny and files and mod That as well.

Offline MrJohnK

  • Posts: 15
I don't mind at all to help you out on the programming side as it relates to a Teensy 2.0.  I can donate what is already up on Github as well as my full implementation of the trackball I made with all the bells and whistles.  I don't mind sharing.

As for mod'ing existing trackballs, my old trackman marble wheel remains intact as it was in the early '90s when I bought it.  I didn't see any great way to mod it for adding a new sensor to it.  As was noted earlier in this thread, this sensor does require more room than I saw available in the existing body.  I ended up printing an entirely new trackball body of my own design to get what I wanted.  I look forward to seeing how creative people can be by ripping out the guts of their existing trackball and equipping it with a new high-resolution sensor. 

JK

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
I don't mind at all to help you out on the programming side as it relates to a Teensy 2.0.  I can donate what is already up on Github as well as my full implementation of the trackball I made with all the bells and whistles.  I don't mind sharing.

As for mod'ing existing trackballs, my old trackman marble wheel remains intact as it was in the early '90s when I bought it.  I didn't see any great way to mod it for adding a new sensor to it.  As was noted earlier in this thread, this sensor does require more room than I saw available in the existing body.  I ended up printing an entirely new trackball body of my own design to get what I wanted.  I look forward to seeing how creative people can be by ripping out the guts of their existing trackball and equipping it with a new high-resolution sensor. 

JK

Did you write the entirety of that code on github? Which pins did you use on the teensy 2.0? I wonder if the same pins work for the 3.0. It would be cool if you could explain the code on github in its entirety.

Do you have a copy of the Avago C8051F347 Firmware that they supply to people who are going to make mice with their ADNS-9800 laser sensors? That way it should be much easier to change the code to my purposes since it already has code for:

the ADNS-9800 pointer movement
a scroll wheel
3 mouse buttons (I would add support for 2 more)
3 LEDs roughly indicating DPI (I would alter them to light up the socket when the mouse is being moved)
and 2 buttons to increment/decrement the DPI by 200 (they can also be used to increment/decrement the liftoff distance by 0.3mm) (I would alter it to change between 5-8 defined DPI levels)

(This is in the PDF sheet for Avago's C8051F347 Firmware Version 2.8 from 11JAN12)
« Last Edit: Fri, 07 June 2013, 19:36:36 by The_Ed »
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline MrJohnK

  • Posts: 15
Indeed, I do have a copy of the C8051F347 files.  When I asked for it, they even sent me the source code, which surprised me.  Collectively, the chip refers to this as the "A4" code version.  I formatted the binary hex compiled file from the A4 firmware into the Arduino sketch there on my Github, so it is there for everyone to get. 

I didn't write all of the code that appears there, especially around the start-up procedures.  There were a couple of other copies of similar code already up on Github for both the ADNS-9500 and ADNS-9800 that I was able to adapt.  There is quite an elaborate set of hoops to jump through upon each startup in order to get the firmware uploaded and all the right ports reset and ready to run.

On the Teensy, you just connect up the four lines for the SPI port, which are 0, 1, 2, 3 (SS, SCK, MOSI, MISO respectively) along with power, ground and the interrupt line, which could be any one of pins 5, 6, 7 or 8 as they all handle hardware interrupt functions.  In the Arduino software, you just use the SPI standard library to interact with the chip.

The operation of the chip is relatively simple.  You attach an interrupt to one of the interrupt pins as "falling".  When that pin goes low, the interrupt routine runs that simply reads a specific register inside the chip.  This register contains the X and Y movement delta.  Once this is read, the interrupt line goes high again until motion is detected.  The X and Y delta data is in 2s complement format, so you'll need to convert that.  I wrote a little formula in my source code that does this.  Usually, you end up with a 1, -1 or 0 after you read that information.  That indicates how far to move the related axis.  Conceivably, you could receive a larger number, but I think the chip is so fast it reports just a string of 1s.  Those report faster the more you move the ball.

As for setting the resolution, there are 41 steps from the slowest resolution to the fastest.  I choose to make a capacitive touch button on my trackball that steps from one end to the other, one at a time so I can get just the right speed for any job from CAD work to gaming.  You could also just choose a few reasonable step values and tie those to physical buttons.  All you do is write a single hex value into a register on the chip to change the resolution on the fly.

Mouse buttons, keyboard strokes and scrolling can be handled with the Teensy and it's easy to use USB HID capability as a mouse and keyboard composite driver under any operating system.  It just works.  Paul at PJRC did an outstanding job with that.  I've not tried his Teensy 3.0 yet...I've only ever played with the 2.0 and 2.0++ versions. 

Hope that helps.

-John

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
Indeed, I do have a copy of the C8051F347 files.  When I asked for it, they even sent me the source code, which surprised me.  Collectively, the chip refers to this as the "A4" code version.  I formatted the binary hex compiled file from the A4 firmware into the Arduino sketch there on my Github, so it is there for everyone to get.

Thanks for that explanation, that helps a lot. But in C++ there is a "Main ()" function that calls the rest of the voids when needed, so I don't understand how your code is called...

Are you saying that the "ADNS9800_SROM_A4.ino" file is the C8051F347 Firmware? So what firmware version 2.8 had all those features that I listed above in it's code?
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline MrJohnK

  • Posts: 15
Since this is interrupt driven, the call to the subroutine that reads from the chip is not called from the main loop like most other subroutines.  Near the top of my source code, look at this statement:

attachInterrupt(0, UpdatePointer, FALLING);

Using this, you don't need anything in the main loop to get functionality of the chip.  The UpdatePointer subroutine calls each time the interrupt 0 pin goes low.  My code is an Arduino sketch, not C++.  In my full trackball code, my main loop is dedicated to scanning buttons to see if any of them have been pushed and dealing with those events.

When I asked for the firmware, they sent me the "A4" text file that just has a string of hex values, one per line.  Also included in their response was a folder named:
A5059M_NRD1101_V2_8_Full_Spd-1ms_hardwareSPI_9800_(with TCL N SROM hardcode)

Inside this folder is another subfolder labeled:
C8051F347

Inside of that is all the C source code.  I have not done anything with the source code.  I just took the A4 file they sent and reformatted that for my Arduino sketch and use that to upload to the chip each time it boots.  It works.  I'm not sure how I would go about cross compiling the source code for that chip as I'm not sure what architecture it uses.

Offline metalliqaz

  • * Maker
  • Posts: 4951
  • Location: the Making Stuff subforum
  • Leopold fanboy
I jumped on this just to have one.  If I get project together I will make some proper firmware

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
Since this is interrupt driven, the call to the subroutine that reads from the chip is not called from the main loop like most other subroutines.  Near the top of my source code, look at this statement:

attachInterrupt(0, UpdatePointer, FALLING);

Using this, you don't need anything in the main loop to get functionality of the chip.  The UpdatePointer subroutine calls each time the interrupt 0 pin goes low.  My code is an Arduino sketch, not C++.  In my full trackball code, my main loop is dedicated to scanning buttons to see if any of them have been pushed and dealing with those events.

When I asked for the firmware, they sent me the "A4" text file that just has a string of hex values, one per line.  Also included in their response was a folder named:
A5059M_NRD1101_V2_8_Full_Spd-1ms_hardwareSPI_9800_(with TCL N SROM hardcode)

Inside this folder is another subfolder labeled:
C8051F347

Inside of that is all the C source code.  I have not done anything with the source code.  I just took the A4 file they sent and reformatted that for my Arduino sketch and use that to upload to the chip each time it boots.  It works.  I'm not sure how I would go about cross compiling the source code for that chip as I'm not sure what architecture it uses.

Can I have your full code and everything they sent you? I need that C source code (it is for the C8051F347 chip that they use in the place that we are using a teensy).
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline MrJohnK

  • Posts: 15
Sure thing, I can send it along.  When I got it, I did ask them if I could distribute it to my customers.  They said that would be no problem.  Feel free to request copies via inet2xtreme{at}yahoo{dot}com. 

-John

Offline MrJohnK

  • Posts: 15
On a tangent to the source code, I wanted to get the opinion of the group regarding a small extra feature that one person requested that I'm working for this board.  I've got a prototype of this board coming that should allow you to operate it at either 3.3V or 5.0V.  It will have a set of solder bridges on the bottom to switch it from 3.3V to 5V to better accommodate just about any MCU situation.  The one currently featured works just fine at 3.3V only.  The 5V capability adds resister dividers on the SCK, MOSI and SS pin to level shift them down to 3.3V.  There is already an LDO regulator in the current design that will take care of the power up to 6V.

Does that sound like something you all would like to see?  It would not change the size of the board, but just take up some of that blank space and fill it with a few extra resistors.  Any negative implications you can think of?

Thanks.

-John

Offline metalliqaz

  • * Maker
  • Posts: 4951
  • Location: the Making Stuff subforum
  • Leopold fanboy
^ yes. want

Offline alaricljs

  • I be WOT'ing all day...
  • ** Moderator Emeritus
  • Posts: 3715
  • Location: NE US
Color me confused, but if you're using a Teensy 2.0 or ++2.0 then you're already using it at 5v IO levels.  Have you just gotten lucky and not burnt it out?

Proper 5v support would be a really good idea for anyone using the Teensy 2.0/++2.0
Filco w/ Imsto thick PBT
Ducky 1087XM PCB+Plate, w/ Matias "Quiet Click" spring-swapped w/ XM Greens

Offline MrJohnK

  • Posts: 15
Quote
Color me confused, but if you're using a Teensy 2.0 or ++2.0 then you're already using it at 5v IO levels.  Have you just gotten lucky and not burnt it out?

Proper 5v support would be a really good idea for anyone using the Teensy 2.0/++2.0

A Teensy can be converted for 3.3V operation by soldering a 3.3V LDO regulator onto the bottom of the board.  See below:

http://www.pjrc.com/teensy/3volt.html

Offline alaricljs

  • I be WOT'ing all day...
  • ** Moderator Emeritus
  • Posts: 3715
  • Location: NE US
I always forget that part since I never use it.  So now I'm left wondering what use case 5v has, nothing I do is voltage sensitive.
Filco w/ Imsto thick PBT
Ducky 1087XM PCB+Plate, w/ Matias "Quiet Click" spring-swapped w/ XM Greens

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
I will send you an email for the code in just a sec, thanks!

What's the point of allowing it to work at 3.3v or 5v when anything between 3.3v and 6v is already converted to 3.3v with your current PCB? BTW the teensy 3.0 works natively at 3.3v if I remember correctly.
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline alaricljs

  • I be WOT'ing all day...
  • ** Moderator Emeritus
  • Posts: 3715
  • Location: NE US
There's 2 different voltage considerations.  Power to the device (his 3-6v range)  and power level of the IO.  Right now the IO is at 3.3v and he is considering a 5v mod for IO.
Filco w/ Imsto thick PBT
Ducky 1087XM PCB+Plate, w/ Matias "Quiet Click" spring-swapped w/ XM Greens

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
Ah, so power to the laser will always be fine, it's the IO voltage to the controller that matters. A teensy 2.0/++ would have to be downclocked to work at 3.3v, but a teensy 3.0 would be just fine.

And now I must patiently await that source code...
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
Holy crap!... 77 files...

A good thing about being a student is that I can get ****loads of free licenses to software/operating systems. Time to fire up Visual Studio 2010 Ultimate for the first time this year.
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
My god... There is even commented out code for different purposes... This will take quite a while...

There are so many functions and variables... It's just a USB mouse, why the hell is there so much code?!

OK, so code in real life is WAY different than in books and class... Everything is shortened, so it is hard to follow...
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline MrJohnK

  • Posts: 15
Good luck with that?  If you make something useful of it, let me know. 

Indeed, programming code from real programmers looks nothing like my professors taught me in college.  What you learn in college computer science classes lays a good foundation of the base concepts, but it is really fundamental compared to what is really out there in production work. 

I noticed a fair bit of assembler code in there along with the C code...interesting.

-John

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
Good luck with that?  If you make something useful of it, let me know. 

Indeed, programming code from real programmers looks nothing like my professors taught me in college.  What you learn in college computer science classes lays a good foundation of the base concepts, but it is really fundamental compared to what is really out there in production work. 

I noticed a fair bit of assembler code in there along with the C code...interesting.

-John

I found where you got some of your code from - joshuajnoble

Arduino code is quite different than Avago's code.

Can you give/link me your full trackball code?
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
I think I'm gonna have to learn from the ground up with Arduino... I don't know enough of it to just copy/paste/alter and presto. Hopefully I have enough freetime to get it figured out before the sensor arrives. I think I'm done at looking at code for today... My head hurts... It's probably the white background...
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline alaricljs

  • I be WOT'ing all day...
  • ** Moderator Emeritus
  • Posts: 3715
  • Location: NE US
Arduino is something of a wrapper language so that "sketches" can be added to each other to get a functional whole and run on different MCUs without intimate knowledge of the hardware.
Filco w/ Imsto thick PBT
Ducky 1087XM PCB+Plate, w/ Matias "Quiet Click" spring-swapped w/ XM Greens

Offline MrJohnK

  • Posts: 15
Quote
Can you give/link me your full trackball code?

The code running on the Teensy 2.0 in my current trackball is posted up to Github here:

https://github.com/mrjohnk/Trackball2

-John

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
Am I right in my thinking here?

"void setup()" runs and initializes everything.
"void loop()" then runs continuously.
When the ADNS-9800 senses movement it sends an interrupt.
"void loop()" is then paused and the mouse pointer is updated (moved).
"void loop()" is then resumed.

"void loop()" would contain (or call functions for) button pressing (including those to change DPI and liftoff distance), scrollwheel scrolling, and things with LEDs.
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline MrJohnK

  • Posts: 15
Yep, that all sounds about right.