Rapid Fire Mouse

by WWC in Circuits > Microcontrollers

5190 Views, 19 Favorites, 0 Comments

Rapid Fire Mouse

20.bmp
You ever wanted a rapid fire mouse? Well me either but a lot of gamers do.
When the red button is pressed on the side of the mouse it simultaneously grounds both the left and right mouse buttons at 50 times a second.
Just as if you could press both buttons at the same time 50 times a second, which you could not do. 

This Instructable screams out for a video, but don't have. For now.

The original post of the Rapid fire mouse. 

Schematic

01.bmp
I tried making this circuit with out transistors, Didn't work. So now we use transistors.
There is only 3 pins used plus VCC and GND.
Power and ground is taken right off of the USB connections at the mouse.
All three pins use a 1 meg pull down resistor. 

PB2 is left mouse button. Pin 7
PB3 is right mouse button. Pin 2 
PB4 is trigger button input. Pin 3
Pin 8 is ground.
Pin 4 in +5V.


Parts

04.bmp
Minimal parts are used.

1) ATtiny85
1) 8 pin IC socket.
1) Small piece of proto board.
1) Push button, NO
2) 2N2222 Transistors, EBC
3) 1 meg resistors
 

Assembly

05.bmp
06.bmp
07.bmp
08.bmp
09.bmp
10.bmp
11.bmp
02.bmp
12.bmp
13.bmp
14.bmp
15.bmp
16.bmp
17.bmp
18.bmp
19.bmp

Push Button

03.bmp
20.bmp
Prepare the case. Drill a 9/32 hole for the push button.

Code

images.jpg

 

Load this code with your favorite AVR programmer. I use WINAVR.
I have included the main.c and the make files in the rar download.
I used this Instructable to aid in programming. 


#define F_CPU 1000000UL // frequency (20MHz)
#include <avr/io.h>
#include <util/delay.h>



void on(){
        PORTB |= 1 << PB3; //led
        PORTB |= 1 << PB2; //heater
        }
void off(){
        PORTB &= ~( 1 << PB3 );//led
        PORTB &= ~( 1 << PB2 );//heater
        }


void main() {
        DDRB |= (1<<PB3)|(1<<PB2);
        int ticks;

        for (;;) { //FOREVER
                while ((PINB & _BV(PB4))==0) {} // NOT PRESSED, DO NOTHING
                for(ticks=0;ticks<125;ticks++) // CLICK FOR 5 seconds
                        {
                        on();_delay_ms(20);off();_delay_ms(20);
                        } // CLICK TAKES 1/50'th second
        }
}

Downloads