Gergia
Offline
Newbie
Karma: 0
Posts: 35
|
 |
« on: May 26, 2012, 09:10:57 am » |
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 .
|
|
|
|
|
Logged
|
No one dies virgin , Life fucks everyone !!!
|
|
|
|
0
Offline
Tesla Member
Karma: 71
Posts: 6596
Arduino rocks
|
 |
« Reply #1 on: May 26, 2012, 10:03:04 am » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
Gosport, UK
Offline
Faraday Member
Karma: 19
Posts: 3118
|
 |
« Reply #2 on: May 26, 2012, 10:13:35 am » |
Alternatively, get a USB host shield, and use the HID libraries that are available.
|
|
|
|
|
Logged
|
|
|
|
|
Gergia
Offline
Newbie
Karma: 0
Posts: 35
|
 |
« Reply #3 on: May 26, 2012, 10:59:41 am » |
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 .
|
|
|
|
|
Logged
|
No one dies virgin , Life fucks everyone !!!
|
|
|
|
Pittsburgh, PA, USA
Offline
Faraday Member
Karma: 29
Posts: 2880
I only know some basic electricity....
|
 |
« Reply #4 on: May 26, 2012, 04:17:24 pm » |
Not Arduino but stand-alone AVR's you can program with Arduino: http://www.obdev.at/products/vusb/index.htmlcheck 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
|
|
|
|
|
Logged
|
Examples can be found at Learning in the Main Site and at the Playground
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 269
Posts: 25382
Solder is electric glue
|
 |
« Reply #5 on: May 26, 2012, 04:36:53 pm » |
You can do all this easily if you get one of the new arduino Leonardo boards http://arduino.cc/en/Main/ArduinoBoardLeonardo
|
|
|
|
|
Logged
|
|
|
|
|
Gergia
Offline
Newbie
Karma: 0
Posts: 35
|
 |
« Reply #6 on: May 27, 2012, 01:57:49 am » |
how with arduino Leonardo ? what its advantages and how use as virtual mouse ? thank you GoForSmoke i'll try , that one .
|
|
|
|
|
Logged
|
No one dies virgin , Life fucks everyone !!!
|
|
|
|
France
Offline
God Member
Karma: 2
Posts: 905
|
 |
« Reply #7 on: May 27, 2012, 02:29:54 am » |
|
|
|
|
« Last Edit: May 27, 2012, 02:32:22 am by al1fch »
|
Logged
|
|
|
|
|
Gergia
Offline
Newbie
Karma: 0
Posts: 35
|
 |
« Reply #8 on: May 27, 2012, 03:56:15 am » |
does this libraries would work with Arduino UNO ?
|
|
|
|
|
Logged
|
No one dies virgin , Life fucks everyone !!!
|
|
|
|
Pittsburgh, PA, USA
Offline
Faraday Member
Karma: 29
Posts: 2880
I only know some basic electricity....
|
 |
« Reply #9 on: May 27, 2012, 04:33:07 am » |
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.
|
|
|
|
|
Logged
|
Examples can be found at Learning in the Main Site and at the Playground
|
|
|
|
Gergia
Offline
Newbie
Karma: 0
Posts: 35
|
 |
« Reply #10 on: May 27, 2012, 06:49:37 am » |
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 .
|
|
|
|
|
Logged
|
No one dies virgin , Life fucks everyone !!!
|
|
|
|
Gosport, UK
Offline
Faraday Member
Karma: 19
Posts: 3118
|
 |
« Reply #11 on: May 27, 2012, 06:53:03 am » |
A link to v-usb has already been posted by GoForSmoke. Google will have more.
|
|
|
|
|
Logged
|
|
|
|
|
Delray Beach, FL USA
Offline
Full Member
Karma: 0
Posts: 112
|
 |
« Reply #12 on: May 27, 2012, 08:02:54 am » |
Lookup project LUFA on google, and get something like a teensy that has a built in USB controller on the chip.
|
|
|
|
|
Logged
|
|
|
|
|
Pittsburgh, PA, USA
Offline
Faraday Member
Karma: 29
Posts: 2880
I only know some basic electricity....
|
 |
« Reply #13 on: May 27, 2012, 08:18:06 am » |
Giorgi, V-USB site is at http://www.obdev.at/products/vusb/index.htmlDidn'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.
|
|
|
|
|
Logged
|
Examples can be found at Learning in the Main Site and at the Playground
|
|
|
|
Gergia
Offline
Newbie
Karma: 0
Posts: 35
|
 |
« Reply #14 on: May 27, 2012, 12:28:19 pm » |
practical is least-parts-cost , so thank you i'll do my best , if I have some questions let me ask you? thanks .
|
|
|
|
|
Logged
|
No one dies virgin , Life fucks everyone !!!
|
|
|
|
|