I want to conduct an arduino to the USB of my computer and connect it to two buttons. Pushing on will have the same effect as a left click of a mouse and the other as a right click.
Not sure how to begin when it comes to sending signals to computer via USB.
If that's all you need it to do, I would buy an ordinary USB mouse, wireless or not, and either:
- make a mechanical device (a box with the mouse inside, with pedals that click the mouse)
- take apart the mouse and solder wires to either side of the buttons on the mouse's circuit board, then buy 2 big electric buttons (or make them: buttons are just contacts held apart until you push them) . When the wires contact, it will click.
You may also want to read about hardware debouncing. Eg http://electronics.stackexchange.com/questions/64770/is-it-possible-to-use-just-a-capacitor-to-debounce-a-button Depending on your mouse, maybe the mouse will handle it for you.
Since buttons are just 2 contacts coming together and making an electrical connection, they tend to "bounce" as the connection is made and lost and made again within fractions of a second. So what you intend as one click might act like a bunch of clicks in fast succession. Debouncing is a series of techniques you can use to counter that. Hardware debouncing uses a capacitor to store charge so the spikes you get from the bounce are ignored
- If you want to get fancier and spend more money, you could get an Arduino Leonardo, Micro, or Due and program it to act like a mouse but you will still have to make an enclosure with pedals. See: http://arduino.cc/en/Reference/MouseKeyboard
If you use an Arduino, you could also use software debouncing as well as, or instead of, hardware debouncing.
Software debouncing is usually just using a timer in your program to ignore button clicks within a very short (microseconds-scale ) interval.
Thanks.. initially I thought why not use the Arduino (just for fun) but after more thought I will go with the mouse idea