Arduino as USB mouse

hi , I'm interested in how replace USB mouse with arduino and inherit all mouse abilities .
like right and left clicks and it's coordination on X and Y axis .
I would like to send all information from arduino to PC and work properly .
For ex : I have analog inputs as X and Y axises , and 2 buttons for right and left buttons .

I think to do that you would have to program the 4U2 or 8U2 USB chip on the Arduino board to mimic a USB mouse, as standard the firmware for the Uno has it as a standard serial device. Be warned USB protocol is not nice and simple.

Alternatively, get a USB host shield, and use the HID libraries that are available.

is there any library which will mimic as USB mouse , or better idea is PS/2 mouse , since I don't want to spend money .
also , please if PS/2 would be easier and cheaper please inform me .

Not Arduino but stand-alone AVR's you can program with Arduino:

check out the project examples.

There are also the 'Arduino compatible' Teensy and Teensy++ with USB/HID libraries. They use USB capable AVR's and come fully assembled. If you spend the extra to get 'with pins' then it will plug directly into a solderless breadboard.

http://www.pjrc.com/teensy/index.html

You can do all this easily if you get one of the new arduino Leonardo boards

how with arduino Leonardo ? what its advantages and how use as virtual mouse ?
thank you GoForSmoke i'll try , that one .

Mouse library for Leonardo described here :

Mouse code for Leonardo here :

does this libraries would work with Arduino UNO ?

They don't.

UNO has a USB chip but it's for connecting to a PC and not easy to change. The chip you program on the UNO is an ATMega328P and won't use those libraries made for a USB-capable chip.

You can use V-USB with non-USB ATTiny and ATMega chips but you must assemble parts and program the chip, learn how to use a programmer and build to do it. The V-USB site has the information and library to do that, but it's not falling-down simple.

With the Teensy's and the Leonardo all the assembly work is done. They cost more but the path is shorter and smoother.

If you only want to make one or a few then the buy-assembled route is cool. If you want to make many or just want to make saving easier then the V-USB route is cheaper in the long run.

all right , as I guess B-USB is more practical , so , please give me some detailed information , like web links and so on , I would be very thankful .

A link to v-usb has already been posted by GoForSmoke. Google will have more.

Lookup project LUFA on google, and get something like a teensy that has a built in USB controller on the chip.

Giorgi, V-USB site is at http://www.obdev.at/products/vusb/index.html
Didn't you look already? Be sure to check out the example projects, each has a link as well.

As to V-USB being more practical, it depends on how many of the same thing you want to make or if you want the least-parts-cost way. But if practical means quickest, easiest and still less than $30 then a Leonardo or Teensy will be better. Practical is what is practical for your means and needs.

practical is least-parts-cost , so thank you i'll do my best , if I have some questions let me ask you? thanks .

I searched for info and got such an amazing video

but I can't understand , since don't know Japanese , has anyone got any idea
how this thing works and what I need ? I want to do exactly same device ,
please help me .

I want to do exactly same device ,
please help me .

No you don't, I told you what to do and you totally rejected the suggestion.

It looks like he is using Linux so he could have any input driving the mouse, it is certainly not a USB device he has.

Giorgi, are you having trouble navigating the V-USB site?

To make your own mouse I think will cost more than just buy a cheap mouse. The projects there are to make things you don't ordinarily find in stores, or find cheap, like the tilt-mouse.

You know that least-parts-cost means most-your-time-cost? What is your time worth? Will the lessons you learn make it worth it? You can learn a lot just making a $16 Teensy do HID.

Giorgi,
I tend to agree with you. The video does appear to be an Atmel chip with usb interface. I say that by looking at the resonator around pins 9 and 10 and the diodes that could be 3.3v zeners.
Also the file that is opened references the website "obdev.at/goto.php. And of course the most telling is the video is titled "V-USB HID Mouse".

So yes, I think you want something exactly like this video. And I do too.

Something that I read and I am thinking about trying is:

It has limited utility in that you only have 4 data pins to work with but the USB interface is already on the board. (and it's cheap)

I too am having trouble getting an Arduino to act as an HID device. I'm trying a keyboard first but I would try a mouse if I thought I could get it to work.

All right , I am sorry Grumpy_Mike that I rejected your suggestion but I don't want to buy arduino Leonardo .
the examples which are on V-USB have other basis or purposes , and they are very complicated .

I have got an brilliant idea , what happens if I buy simple USB mouse and interface it with arduino . e.g USB mouse would be as a
USB interface and use some pins to control cursor ?
is It possible. ?