and migrated the sketch to a Mini Pro this night. Wanted to know IF It is a good practice to use an available pin to feed signal for a pull up switch. Do you know what I mean? For example, I have pin 8 and 9 free, and would like to use one of them to supply trigger switch.
Instead of having a button be the switch, you would set one pin to an input, and one pin to and output and then just connect them. You would control the "switch" but using a digitalWrite High or Low command for the output pin and then just use digitalRead elsewhere in your code to detect whether its on or not.
Right. My problem is that I will be using an unregulated power supply to feed the arduino mini pro, so I don't have a 5v power source to feed the switch. So I was thinking in re-use an available pin to do that work.
Oh, is this whole thing operating at 3.3V? If you have enough power to send a HIGH signal to the microcontroller, then you can still use the button by feeding it 3.3V.
What the button does is just make a circuit. When its pressed, it completes the circuit. Since the output is connected to the arduino, and if the whole thing is running at 3.3V and is using 3.3V logic, then getting a t 3.3V from the button will still send the HIGH signal.
What voltage are you going to be using? Is this a 3.3v pro mini or a 5v pro mini.
Added for 1.0.1. Just tested and worked out like a charm. Right now testing an Ethernet shield r3. Connected it to the laser gun project and every time the server detects an incoming connection fires the laser gun. Very funny.
I too am working on code for a blaster (blasterOSv1.0)
similar to yours..
I have it doing a:
'power on/boot sound'
slider switch for manual fire or auto fire
RGB led so I can pick my color for fire type(s)..
my last step was to add a motor.. so I could spin the barrel like a gatling gun.. but I havent been able to find a small motor with enough torque and speed to work..
Very cool blaster idea. Love the automatic firing option. Not applicable to V Visitor laser gun, but could be implemented for other ones. Will add that feature to my software. Implemented the INPUT_PULLUP pin method and combined it with the Ethernet shield.
Now I am activating the trigger over the Internet from my work and the laser gun is resting at my dinner table at home. Cool right?