Pages: [1]   Go Down
Author Topic: Arduino PS2 mouse interface  (Read 598 times)
0 Members and 1 Guest are viewing this topic.
Austin, TX
Offline Offline
Full Member
***
Karma: 2
Posts: 182
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
   I have posted an article in the playground about how I connected a PS2
mouse to an arduino.  Look for it in the sidebar.

Enjoy,
« Last Edit: January 08, 2007, 12:03:51 pm by ckiick » Logged

Chris J. Kiick
Robot builder and all around geek.

Florida, USA
Offline Offline
Full Member
***
Karma: 0
Posts: 146
meow!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Nice job!  I don't have a PS2 mouse right now, but it was interesting to see how the code worked.  Interesting that both X and Y are a single byte... are they actually X and Y, or are they delta-X and delta-Y since the last time you talked to the mouse?
Logged

Austin, TX
Offline Offline
Full Member
***
Karma: 2
Posts: 182
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks.

The mouse resets the counters after they are read, so the X and Y are deltas.  Also note that the sign bits for X and Y are in the status byte, so if you care about the direction, you have to check that as well.

It's also possible to get an unsigned 'Z' byte by putting the mouse into a different mode.
I didn't find that very useful, however.

Logged

Chris J. Kiick
Robot builder and all around geek.

Pages: [1]   Go Up
Jump to: