Well i cant really see whats going on behind that hot-snot glue (which you can remove with rubbing alcohol, if need be )
But the microswitch (the one you call arcade) is super easy to solder several wires onto, as it has got a hole in the lead which you can hook the end of the wire around before soldering... heck even after if you heat the solder up before.
BTW they are easily obtained, they go by the name 1c25, there are other types such as DB1, DB2 & DB3 but they have a different size, just if need be
and the pcb with the red button(s)? should be pretty easy to wire up with a common ground wire aswell.
Here's a couple of pics of my gun, which surely could use some tidying up.
https://drive.google.com/open?id=1-2D4oAQEHhFUM4F9ROmfW6oOpiYpz_iA
Though there are 2 wires connected on one pin of the trigger pcb, the rest are daisychained from there. Just as it was from the factory.
Also should you need spare pcb's, provide me with a drawing with measurements and holesizes.
and i'll design a new one for ya
I could even make one that extends rearward which can hold the arduino, mosfet and all the supporting components.
You wouldnt happen to have a scanner and a ruler would you?
Cause if you lay the gun, or even guns on their (in)side next to the ruler and send me the picture i'll design it to work for that gun.
You'd ofcourse have to make sure that it is clean against the glass, so that there's no warping or out of focus places.
and i'll make it so you have several through-holes where you can attach the ground wires
EDIT:
@JayBee, if you wanted to have me take a look at your code, make a user on github and make a private repository for it and share it with me
EDIT2:
I dont think you should have the camera board act as the ground for the solenoid as that could actually deprive the camera of power on activation (read. inrush current)
what you'd ought to have is a beefy capacitor, maybe even a super capacitor to conserve space right next to the mosfet.
Yeah despite what many people say, hot glue is so convenient when you don't have 3D printer or anything like that. Easy to put, easy to remove, and hold things very well.
There is simply a push button for calibration and other functions behind it.
Yeah I guess I could have soldered everything on the switch, but again it would have been a pain everytime I want to modify/add anything, and the placement in the gun is not the best to pull all grounds to it (not enough space).
This is not the original switch by the way (those kind of gun don't have microswitches), I added them along with a 3D printed supports I bought online
Nice to know the ref if I need to replace them, thanks
Your gun is so tidy compared to mine, good idea to reuse the thick cable to bring all your wires to the board. I guess having a solenoid doesn't help
For the common ground with the cam don't worry, the solenoid circuit prevent any of those issues.
Sorry I don't have access to my computer lately, couldn't do the schematics or clean my code before sharing it with you yet, it might have to wait 2 more weeks for that
I will send you a PM as soon as it's ready
I'll throw some cents in here:
Mice in windows can be setup two ways. Either as a relative position device, which works as you think it does (x number of ticks in a given direction) or absolute position... which I believe gives the x/y position in a 0 to 1024 value in both x and y. Imho neither of these should be used as output to make a modern light gun. Why? Well windows handles mouse input surprisingly poorly. One mouse read in relative position does just fine but absolute position or multiple mice aren't universally supported in games. As a matter of fact, the reason troubleshooter, troubleshooter 2 and demulshooter exist is due to the poor mice support in the typical gun game released on the pc... even some emulators. This is due to the fact that the various apis used to interface with multiple mice are outdated and/or cumbersome.
On the other hand if your gun shows up as a joystick you are golden. Most modern games can handle two gamepads just fine and as a quick kludge to support older games, it's pretty easy to use middle ware to move the mouse cursor with a joystick. Multiple mice aren't officially supported in any commercially available games due to the api issues, so going forward, any gun games released on the pc are probably going to have gamepad support, with developers assuming you'll actually use a gamepad since true pc guns are dead atm. That's just fine if you make a new light gun show up as a joystick, but it means more hacking if you have it show up as a mouse.
Thanks, you summed up things quite well.
2 mouses support is indeed a pain to work with, but at the same time there are also many games that don't support absolute coordinate joystick, only relative joystick.
When using only one gun, mouse mode it's a lot more simple, and you can use it natively in windows or with any devices that use a mouse. That's mainly why I left the mouse mode as default.
During my test, I felt like the joystick mode was also slightly less precise and had more input latency than the mouse, but that might depends on the app, and the library I am using.
That explains why arcade developers almost always choose to have the gun I/O board output as an analog joystick, regardless of the gun tech. Modern arcades are PC's under the hood so they probably have to deal with all the same challenges
Also, if the plan is to make a gun work with older consoles on HD flat screens, most light gun games already have analog joystick support. A few of the PS2 rail shooters I have tried even offer a choice of relative or absolute positioning (they call it "regular" and "pro" mode). I am relying on this to add light gun support to the few PS2 rail shooters with no gun support once my Sega arcade IR gun is set up.
House of the Dead 4 on the PS3 even offers calibration and an option to turn off visible crosshairs when played with an analog joystick. I have high hopes for using my HOD4 arcade gun with it (with the I/O wired to a PS3 six axis pad).
Do you have any insight on which mouse mode the Aimtrak uses when set to work as a mouse? It kinds seems like it works in relative mode as it doesn't seem to have the capability of recording accurate coordinates.
Why do people seems to think my firmware only work in mouse mode? Is my first post not clear?
It works as a mouse/keyboard, a joystick, or hybrid (mouse motion and joy buttons, useful for the MiSTer FPGA). All using absolute coordinates of course.
You can change the mode on the fly at any time with a button combo (see my first post).
For the input/output subject, I was speaking about it from the arduino board point of view.
So the input here are the IR cam and gun buttons, and the output are the USB port, solenoid & rumble motor.
The USB output can be change in any way I want, in this case it simulates a mouse, a keyboard and a joystick, all at the same time.
On the IR cam side, as you can imagine it doesn't provide any screen coordinates, but instead gives me up to 4 IR led 2D coordinate (which are placed in the middle of each TV side, which is way better than putting them in the corners).
So with those I have to do a lot of calculation (mostly trigonometry) to do the aspect ratio/angle correction and get the aiming coordinates, while keeping everything fast enough to not add input latency.
It was the main challenge and what took me countless hours, since keeping those calculation accurate in any situation with the limited arduino power is far from easy.
What hyo2012 was asking was to plug a real analog gun as input instead of the cam.
Doing that would require to completely bypass all the IR cam calculation, which is pretty much the core of my firmware.
It's doable of course, but then I would have to reserve 2 analog input (which I can't because of all the input the GCon 2 needs) for it and deeply modify my code. It would be faster to do a whole new firmware instead.
By the way, I received the lightgun I ordered from ebay (the one from the link you sent me), and it's actually using a motor instead of a solenoid to trigger to recoil.
It's awesome for auto mode, but not that great for one shot. Due to the way the motor has to turn to trigger it, it's slower to react and the impact backward is weaker than forward.
But overall it's a great gun to use with my CRT and PSX/Saturn, I think I will just use it like that instead of modding it