Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: SAMCO DIY Arduino Powered IR Light Gun  (Read 84900 times)

0 Members and 1 Guest are viewing this topic.

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
SAMCO DIY Arduino Powered IR Light Gun
« on: June 17, 2019, 09:23:33 am »
Hi Guys,

I'm currently working on an Arduino powered light gun for use use on Windows & RetroPie have a look at the demo here.



Let us know what ya think, anyone keen to have a crack at building this? I hope to have a build guide up soon.


Cheers Sam

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #1 on: June 17, 2019, 07:59:49 pm »
That's really impressive man.  We are starting to move away from ir-based systems due to the issues that usually revolve around them, but a diy gun is a really good idea.  I look forward to the guide. 

thet0ast3r

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 77
  • Last login:October 26, 2020, 02:10:37 pm
  • Chihiro ftw
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #2 on: June 18, 2019, 05:28:35 am »
Nice work.
I am assuming you are using the DFRobot IR positional camera, that returns positions of the 4 brightest infrared points?
One problem I saw with that approach was, that the field of view is pretty narrow ( almost as narrow as the wiimote`s field of view ).
The result of your work should be pretty comparable with the aimtrak lightguns, probably even in cost.

Don`t get me wrong, I really like it; however when I see an approach I almost have to point out what I think could be problems...
 :laugh:
thet0ast3r

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #3 on: June 18, 2019, 07:16:39 am »
Nice work.
I am assuming you are using the DFRobot IR positional camera, that returns positions of the 4 brightest infrared points?
One problem I saw with that approach was, that the field of view is pretty narrow ( almost as narrow as the wiimote`s field of view ).
The result of your work should be pretty comparable with the aimtrak lightguns, probably even in cost.

Don`t get me wrong, I really like it; however when I see an approach I almost have to point out what I think could be problems...
 :laugh:

Thanks Man, yeah you're bang on. The project as it stands is very similar to a Aimtrak. I just wanted to make a gun that was as plug and play as possible, that people could customise as they need and hopefully improve on as I found out more. I've already found a wiiMote hack that uses 4 iIR leds as opposed to 2 which looks promising. But I think the real main reason is that I'm just nerd and wanted to have a crack at building one these myself  :lol

thet0ast3r

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 77
  • Last login:October 26, 2020, 02:10:37 pm
  • Chihiro ftw
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #4 on: June 18, 2019, 09:10:12 am »
Yeah, the problem with 4 points is: (or atleast my problem was)

I could not solve the Perspective n Point problem for 4 points on an arduino in real-time ( 60 fps) as it involves quite a lot of math.

https://en.wikipedia.org/wiki/Perspective-n-Point

I haven`t looked into it, but it  might be possible to solve it via lookup-tables? could be close to the computational limits of an arduino though.
Keep us updated if you manage to implement anything. :)
thet0ast3r

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #5 on: June 23, 2019, 08:33:51 am »
Hi Guys, just a quick update. Build Guide is now available...

meltman

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 237
  • Last login:December 17, 2021, 07:45:27 pm
  • Brilliant!
    • forum.arcadecontrols.com/index.php/topic,158544.0.html
    • My arcade gallery
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #6 on: June 28, 2019, 04:33:49 pm »
Fantastic work man.

Dam0

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:July 07, 2023, 06:50:40 am
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #7 on: July 06, 2019, 02:42:49 am »
nice, ive ordered the bits, cant wait.

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #8 on: July 28, 2019, 08:45:25 am »
Hey Guys, just another quick update. PlayStation 1 & SEGA Saturn setup video is now up!


Ginsonic

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 96
  • Last login:October 09, 2023, 12:56:04 pm
  • Arcade enthusiast !
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #9 on: July 29, 2019, 05:35:39 am »
Really nice Samco, thanks for your sharing! I have already got all parts, but still no time to test.
It only seems, that the cursor is a little bit jittery, do you think, it can be made more smooth (maybe a simple smoothing algorithm in the sketch)?

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #10 on: July 29, 2019, 07:00:34 am »
Thanks @Ginsonic, I'd love to know how ya go!

Yeah, I did play around with smoothing a little bit but as I use it for gaming I didn't want to add any latency, and I don't really notice the jerking that much when I'm actually playing (generally play with cross hairs off when I can). However, if you're using this for something else like a dedicated mouse cursor, then yeah, a smoothing script is probably a good idea as currently double clicking an icon is near impossible. I used this library https://github.com/MichaelThessel/arduino-analog-smooth when I was when I was mucking around with it.

Ginsonic

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 96
  • Last login:October 09, 2023, 12:56:04 pm
  • Arcade enthusiast !
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #11 on: July 29, 2019, 08:12:06 am »
I usually take a bunch of analog values in a loop (about 5-10) and then divide the total by the count of measures. Mostly simple and effective, but I will see, as soon as I have finished my MPU6050 based XInput Lightcannon project (similar to a Deadstorm Pirates control panel including a steering wheel ;) )

http://www.ifunpark.com/wap/eacp_view.php?id=81
« Last Edit: July 29, 2019, 08:14:03 am by Ginsonic »

lightgungamer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 57
  • Last login:September 24, 2020, 02:43:28 am
  • I love playing Light Gun Games
    • LightgunGame.com
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #12 on: August 09, 2019, 09:07:06 am »
This looks great.

Have you given any more thought to using the 4 leds discussed above?

If it increased accuracy above what you typically get from guns like the Aimtrak then it would be even better.
https://LightGunGamer.com - every Lightgun game and how to play them
Dolphin Emulator

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #13 on: August 11, 2019, 04:25:16 am »
Yeah, I'm still looking into a 4 LED option but I'm actually pretty happy with the accuracy now. Good timing really I've just uploaded a video which demonstrates it pretty well...



Still looking into the 4 LED version thou because as it will shorten the distance you have to be away from the screen (current version is about 2.5 screen widths) and possibly even reduce latency.

lightgungamer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 57
  • Last login:September 24, 2020, 02:43:28 am
  • I love playing Light Gun Games
    • LightgunGame.com
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #14 on: August 11, 2019, 06:11:44 am »
Hey, That looks great.

How does it cope if you move position? Thats always the shortfall with the aimtraks etc. If you shift a little way from where you calibrated the gun then the accuracy goes way off so I was just wondering how well it handles that?
https://LightGunGamer.com - every Lightgun game and how to play them
Dolphin Emulator

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #15 on: August 14, 2019, 04:31:22 am »
Thanks lightgungamer!

To be honest this was something that I really hadn't checked too much before, so just had to do a quick test. The LED's I use from Adafruit don't have a particularly wide viewing angle but if I go from maximum left position (gun pointing just left of screen when straight on) and maximum right position (opposite for right position) it doesn't seem to change all that much. However if I go from sitting to standing there is a decent change, curser probably moves about 20 pixels down. Not sure how this compares to the Aimtrak?

I'm currently looking for wider angle LED's for the sensor bar, so when I find them I can do some better tests.

Cheers

lightgungamer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 57
  • Last login:September 24, 2020, 02:43:28 am
  • I love playing Light Gun Games
    • LightgunGame.com
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #16 on: August 17, 2019, 09:57:36 am »
That sounds really good to be honest.

I haven’t had a chance to do a proper test but I always noticed the drift when moving side to side more.

I’ve been trying to get my head round how it works out the position and it seems like you could account for sideways movement based on the previewed distance between the LEDs but I can’t think of anything that could deal with up and down movement if the leds at on the same level.

I’ve ordered the pcb from you so I’m going to give this a go and build it.
I’ve started a write up on my site here https://lightgungamer.com/how-to-build-your-own-lightgun/

I’m going to add more to it once I’ve got it built.

One thing I was wondering though is if you think the M4 board would work for the build as the M0 seems to be out of stock.

I love what you are doing here. Apart from anything else, it’s a really accessible way for people to have a go and play around with this.


Sent from my iPhone using Tapatalk
https://LightGunGamer.com - every Lightgun game and how to play them
Dolphin Emulator

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #17 on: August 19, 2019, 08:54:41 am »
Yeah, it's super hard to get your head around and then throw in tilt correction it's even tricker. I will make a sort video on how the tilt correction works eventually :)

That's so cool you got PCB, I'd love to know how you go. I'll be really interested to see how you feel the SAMCO compares to other guns you've tried. And yes did a quick check for you the ItsyBity M4 has exactly the same pinouts as the M0 and and from what I can tell doesn't share any of the pins I used with I2C (the reason why the AtMega32u4 doesn't work unfortunately) so you can use the exact same sketch.

Also thanks for the review & general interest in the project. I really appreciate it!

I really like what your doing with your page too. Lots of resources to get even more light gun games up an running :)
« Last Edit: August 19, 2019, 09:36:59 am by samco »

johnm

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 130
  • Last login:February 04, 2024, 03:05:24 pm
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #18 on: August 21, 2019, 06:00:05 am »

Excellent work there samco, I've picked up a couple of Namco Guncon but as my intention would be for my kids to use it then the issues with height would show up as the guns are passed around so i might wait till its tweaked out or they get bigger :D

One thing I did like about your approach is the us of arduino, my limit to programming was typing basic listings printed in C&VG magazine into my ZX Spectrum back in the 80's but could that arduino be programmed to interface with different consoles much like the Kade did as a joystick encoder. With the rise in Retro CRT's becoming hard to find and expensive a Lightgun that imitates a joystick/mouse sounds like a winner

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #19 on: August 21, 2019, 09:08:55 pm »
I'll answer that one...…  If the games in question could also be controlled via an analog stick then yes, but if it's light gun only then probably not.  Most light guns simply send two inputs to a console..... when the trigger is pressed and when the light sensor sees light.  The timing of one vs the other is used by the game to calculate position.  Since there isn't a way to fake that it won't work easily.  If the game allows joystick support then it could work.

johnm

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 130
  • Last login:February 04, 2024, 03:05:24 pm
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #20 on: August 22, 2019, 04:41:17 am »

Thanks Howard, yeah I was thinking more along the lines of PS1, PS2, Dreamcast and OGXbox where most, if not all games would have a joystick control option.
I think that with Sinden on the Horizon people are just waiting to see what it's like or if we can make our own, from what I'm aware it needs other software running so that makes it a no go for older sytems but this with the arduino could make it perfect for those wanting to play their old games on an LCD

lightgungamer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 57
  • Last login:September 24, 2020, 02:43:28 am
  • I love playing Light Gun Games
    • LightgunGame.com
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #21 on: August 22, 2019, 07:27:10 am »

Thanks Howard, yeah I was thinking more along the lines of PS1, PS2, Dreamcast and OGXbox where most, if not all games would have a joystick control option.
I think that with Sinden on the Horizon people are just waiting to see what it's like or if we can make our own, from what I'm aware it needs other software running so that makes it a no go for older sytems but this with the arduino could make it perfect for those wanting to play their old games on an LCD
Andy , the creator of the Sinden Lightgun had demoed a poc bit of hardware using a pi that works with ps1 and ps2. I think he said it would theoretically work with other consoles.
I would have thought that this gun(Samco) would be able to work with the ps2 as the aim track gun that works in a similar way does, at least with some games.
You can also play pretty much all the old Lightgun games using an emulator but were you more interested in using the original hardware?
https://LightGunGamer.com - every Lightgun game and how to play them
Dolphin Emulator

johnm

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 130
  • Last login:February 04, 2024, 03:05:24 pm
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #22 on: August 22, 2019, 08:09:01 am »

I was under the impression that there was extra software running on top of the emulator(the white border) so dont know how that would be replicated on other consoles.

I still have my saturn and dreamcast consoles along with guns and a CRT, digging them out to set up would be a pain though so anything I do would be on the PC/RPI. There is a market out there though for the consoles I mentioned before, people are spending quite a few pennies for usb/sd , psu and HDMI mods for the likes of Dreamcast and there's also a guy who converts dreamcast guns to work on lcd and are bluetooth. I believe there is a market there for something like this where someone just needs to flash a firmware to get it to work on another console

lightgungamer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 57
  • Last login:September 24, 2020, 02:43:28 am
  • I love playing Light Gun Games
    • LightgunGame.com
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #23 on: August 22, 2019, 08:26:04 am »
I think the Sinden mod adds the border using an OSSC chip as well as handling the output. I could be wrong.
Here’s the video of the mod.
http://www.sindenlightgun.com/blog/playstation-1-and-2-original-console-sinden-lightgun-support/
https://LightGunGamer.com - every Lightgun game and how to play them
Dolphin Emulator

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #24 on: August 22, 2019, 12:50:34 pm »
I would also point out that most (not all) light gun games from the newer systems are ports of arcade games that are already emulated.  If anything a gun solution for older systems is what's needed... if you insist on playing on original hardware anyway. 

For me anyway I would want to setup a small dedicated light gun pc that could just be pulled out and plugged up to the tv when I want to play those games.  Every game would just be on there ready to go.  I mention this because you have to remember that most consoles have 15-20 gun games on them max..... you'll probably only want to play one or two of them.  It's really not worth it swapping around cables and ect. 

lightgungamer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 57
  • Last login:September 24, 2020, 02:43:28 am
  • I love playing Light Gun Games
    • LightgunGame.com
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #25 on: August 22, 2019, 03:45:29 pm »
Yeah, getting one system setup where you can play everything seems like the best option.
The only thing is that it can be hard to get all the emulators set up perfectly so it all just works. Fiddling around with settings between games can be fun but it does take away from the arcade feel.
I’m hoping the Sinden gun makes it a lot smoother or consistent at least.

I really like this project though as it will give us complete control. Ive got all the parts ordered and I’m even hoping to get into the code once I’ve got it working.
https://LightGunGamer.com - every Lightgun game and how to play them
Dolphin Emulator

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #26 on: August 24, 2019, 04:26:01 am »
Hi Guys, loving the chat :)

Yeah, Howards right my Gun simply emulates a mouse so the actual emulator is doing a lot of the work when comes to actually emulating a light gun (which works in quite a different fashion, this video explains it really well youtube.com/watch?v=DzIPGpKo3Ag) there would have to another step in the hardware that would convert the mouse position to this timing based system which is what I assume the Sinden guy is going to implement. The other problem is my gun requires a point on the screen to calibrate to which the old light guns didn't have.

So the SAMCO in it's current state is pretty much emulator only. But who knows is the future maybe it'll evolve, thats the joy of open source :)


lightgungamer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 57
  • Last login:September 24, 2020, 02:43:28 am
  • I love playing Light Gun Games
    • LightgunGame.com
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #27 on: September 05, 2019, 10:19:22 am »
Hey Sam,
I’ve got all my components ready now so I’m going to start building it soon.

One thing I was wondering though is if it would work with a wii sensor bar? It’s just 2 clusters of ir leds.

Have you tried it?
https://LightGunGamer.com - every Lightgun game and how to play them
Dolphin Emulator

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #28 on: September 06, 2019, 05:51:30 am »
Hey man, I actually just bought a cheap aftermarket Wii sensor from AliExpress which has the  /|\   /|\ kind of configuration to try out and I was surprised it worked perfectly. Also increases the angle you can use it at however when you jump from the front facing leds to the left/right pointing ones with recalibrating alignment does go out a fair bit. Have fun putting it all together :)
« Last Edit: September 06, 2019, 05:53:56 am by samco »

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #29 on: September 20, 2019, 10:06:57 pm »
Hi Guys, this is just a quick update to let you know I've added a new sketch to the GitHub for anyone who wants to add a foot pedal to their Samco. It's really simple just grab any momentary foot switch (I used one that was for a tattoo gun there's heap of these on eBay) and solder it to the broken out Alt pins on the PCB (I knew I broken out an extra pin for a reason :) ). Basically all it does is gives you an extra right mouse button but it's great for dual gun mode in Time Crisis II on PCSX2 and it's just cool to have a foot switch. Attached a couple of images so you can see how it all fits.

Also updated the old code slightly so it releases the mouse in pause mode so you can use your normal mouse again when your Samco's paused.

Cheers.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #30 on: September 28, 2019, 02:34:25 am »
Funny I was doing the exact same thing for my light guns  :lol
I also added a plug just outside of the gun to plug/unplug it at will  8)

johnm

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 130
  • Last login:February 04, 2024, 03:05:24 pm
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #31 on: September 29, 2019, 07:22:27 am »


Same here, I was also thinking that i could just reuse the original cable, solder a USB plug onto it and run a cable from that with a socket on the end for the pedal

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #32 on: October 02, 2019, 12:54:35 am »
Hey I haven't looked at the sketch, but what programming language are you using?  I ask because I have Arduino code on this pc somewhere from my racing rig that allowed communication to/from mamehooker via virtual serial port.  If it's added mamehooker can optionally control the recoil.  Just a thought... you may not be that far along yet. 

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #33 on: October 02, 2019, 12:59:31 am »
Hey I haven't looked at the sketch, but what programming language are you using?  I ask because I have Arduino code on this pc somewhere from my racing rig that allowed communication to/from mamehooker via virtual serial port.  If it's added mamehooker can optionally control the recoil.  Just a thought... you may not be that far along yet.
That's very interesting stuff, I didn't know you could interface mame like this!
SAMCO's Arduino sketch as well as mine are using the Arduino IDE and C++, and we can indeed communicate with serial through USB.

I would gladly see the sketch you made for that, that would help immensely :D
« Last Edit: October 02, 2019, 05:24:22 am by JayBee »

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #34 on: October 02, 2019, 08:47:33 am »
Hi Howard,

Yeah, that would be great. JayBee from the post above has already started working on a recoil system. I haven't looked into yet to be honest but it's good to know that it's possible.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #35 on: October 02, 2019, 10:14:44 am »
Hi Howard,

Yeah, that would be great. JayBee from the post above has already started working on a recoil system. I haven't looked into yet to be honest but it's good to know that it's possible.
Indeed, I already made a fully working recoil system with simple 24v solenoids and a small DIY control board.
The recoil activation and timing is controlled by the Arduino, so if I can make it communicate with Mamehooker, it should work great.
I will share the schematics later in my other posts, when I am sure it's working fine after few hours of use.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #36 on: October 03, 2019, 01:13:09 pm »
Ok. 

Obviously it's going to have to be modified a little for recoil so I might try to change it a little before I post it. 

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #37 on: October 03, 2019, 01:37:42 pm »
Ok. 

Obviously it's going to have to be modified a little for recoil so I might try to change it a little before I post it.
Awesome, thank you!
Looking forward to see your code, communicating with mame and other emulators is the last feature I miss in my 4 led setup ;)

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #38 on: October 10, 2019, 10:49:12 am »
Ok. 

Obviously it's going to have to be modified a little for recoil so I might try to change it a little before I post it.
Is there anything special to do in mame64 to make it work with mamehooker?
I followed your tutorial, setup the mame path and all, but when I launch a game in mame, mamehooker doesn't react, no sound, no voice, nothing. And no ini file created either.
Did I miss a step somewhere?  :dunno

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #39 on: October 12, 2019, 01:46:53 pm »
Yes, set output to "windows" in your mame.ini and/or the command line.  There's a sticky about it over in the software forum. 

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #40 on: October 13, 2019, 11:20:52 am »
Yes, set output to "windows" in your mame.ini and/or the command line.  There's a sticky about it over in the software forum.
Ah that explains it. Thanks, now it's working great ;)

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #41 on: October 15, 2019, 07:13:00 am »
Hey Guys, Got my PCSX2 setup guide up for anyone that's interested.



JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #42 on: October 16, 2019, 02:06:40 am »
Hey Guys, Got my PCSX2 setup guide up for anyone that's interested.


So you are actually getting an accurate aiming in PCSX2 by calibrating like that?
That's awesome man! Glad you made it work ;D

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #43 on: October 17, 2019, 02:12:39 am »
@JayBee Yeah, bonus of calibrating in game in guess :) It is quite annoying that mouse is slightly off in most games but as long as calibrate to the little red cross on the calibration screen you should be all good.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #44 on: October 18, 2019, 10:50:26 pm »
@JayBee Yeah, bonus of calibrating in game in guess :) It is quite annoying that mouse is slightly off in most games but as long as calibrate to the little red cross on the calibration screen you should be all good.
I just tested pcsx2. I feel a bit dumb, last time I tested I forgot to disable the widescreen hacks, reason why it wasn't aiming properly. Without it it's working perfectly  ::)
Still looking for a way to play those games correctly in 16/9 tho, it would look great.

lightgungamer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 57
  • Last login:September 24, 2020, 02:43:28 am
  • I love playing Light Gun Games
    • LightgunGame.com
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #45 on: October 20, 2019, 07:23:16 am »
@JayBee Yeah, bonus of calibrating in game in guess :) It is quite annoying that mouse is slightly off in most games but as long as calibrate to the little red cross on the calibration screen you should be all good.
I just tested pcsx2. I feel a bit dumb, last time I tested I forgot to disable the widescreen hacks, reason why it wasn't aiming properly. Without it it's working perfectly  ::)
Still looking for a way to play those games correctly in 16/9 tho, it would look great.
Hey JayBee

What problem are you having with 16:9?
You can set the aspect ratio in the be window settings.
You can also set the window size.
I haven’t found it necessary but you can also set a custom internal resolution in the video plugin settings.

Just setting the 16:9 aspect ratio works for me though.

If you are having trouble where the aim is fine in the Center but drifts off on one or more axis as you go towards the edge then you need to tweak the 4 values in the gun on profiles for the game that you are using to get the aim consistent for your screen set up.

Which game are you trying?


Sent from my iPhone using Tapatalk
https://LightGunGamer.com - every Lightgun game and how to play them
Dolphin Emulator

lightgungamer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 57
  • Last login:September 24, 2020, 02:43:28 am
  • I love playing Light Gun Games
    • LightgunGame.com
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #46 on: October 20, 2019, 07:40:41 am »
Samco - I meant to say that I got all of the parts and managed to build a copy of your gun.

Its almost working but I've obviously done something wrong as the camera doesn't seem to get consistent power. I think I haven't soldered it very well (Its the first time that I have soldered anything in years!)

It works for a few seconds but then when it temporarily loses power to the camera (the red camera light flickers) the whole thing stops working. Would that be the behavior you would expect if it was losing power to the camera?

https://LightGunGamer.com - every Lightgun game and how to play them
Dolphin Emulator

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #47 on: October 20, 2019, 10:53:54 am »
@JayBee Yeah, bonus of calibrating in game in guess :) It is quite annoying that mouse is slightly off in most games but as long as calibrate to the little red cross on the calibration screen you should be all good.
I just tested pcsx2. I feel a bit dumb, last time I tested I forgot to disable the widescreen hacks, reason why it wasn't aiming properly. Without it it's working perfectly  ::)
Still looking for a way to play those games correctly in 16/9 tho, it would look great.
Hey JayBee

What problem are you having with 16:9?
You can set the aspect ratio in the be window settings.
You can also set the window size.
I haven’t found it necessary but you can also set a custom internal resolution in the video plugin settings.

Just setting the 16:9 aspect ratio works for me though.

If you are having trouble where the aim is fine in the Center but drifts off on one or more axis as you go towards the edge then you need to tweak the 4 values in the gun on profiles for the game that you are using to get the aim consistent for your screen set up.

Which game are you trying?


Sent from my iPhone using Tapatalk
You're right, I didn't touch the settings of the plug-in yet, I wanted to see how it was working without changing anything.
The issue I get in pcsx2 is that when I use the widescreen hacks and 16:9 ratio for timecrisis 3 (I must admit it's the only ps2 lightgun game I tested so far), even if the game is displayed well in full 16:9, the lightgun is still registered only in the 4:3 zone of the screen, as it was intended in the original game.
So the aiming is perfect, but I can't shoot on the left and right borders  ::)
Back with native 4:3 it works perfectly.
I will follow your advice and try to change the settings to see if I can make the aiming fit the 16:9 aspect.

For your camera issue, I would check the soldering first, to see if you have no short circuit or bad connection, the led of the camera should be either always on when it's working, or always off. Do you have a multimeter or a continuity tester that you can use?

lightgungamer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 57
  • Last login:September 24, 2020, 02:43:28 am
  • I love playing Light Gun Games
    • LightgunGame.com
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #48 on: October 20, 2019, 06:28:54 pm »
I’ve definitely had that same problem before but I can’t remember how I fixed it. I might have just deleted my install and started fresh.

I’ve just tried it with and without the full screen hacks and it doesn’t seem to make any difference. It works both ways for me.

I would check internal and window resolution and make sure they are both at least in a 16:9 ratio.

Re the camera - I think you are right. I don’t have a multimeter but I’m planning on getting one so I can check. I think that must be it because if I press it at an angle then it seems to fix the connection. I can’t see anything wrong visually though.
https://LightGunGamer.com - every Lightgun game and how to play them
Dolphin Emulator

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #49 on: October 20, 2019, 10:47:09 pm »
Hi Lightgungamer,

Yeah, from your description (especially the part about pressing on it fixes it) it sounds like it probably is a soldering issue. Because your getting power intermittently it must be close to connection thou, maybe try reheating your soldering points. Power is supplied to the camera from pin "5" in my sketch so maybe start with that.


lightgungamer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 57
  • Last login:September 24, 2020, 02:43:28 am
  • I love playing Light Gun Games
    • LightgunGame.com
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #50 on: October 22, 2019, 02:52:49 pm »
Thanks for the reply samco.

I got a multimeter and have started testing it.

I’ve been testing the connection between pin 5 and the + pin on the camera. It sits at about 1.5v normally then goes to about 2.5 when I press on it.
So it seems like the power getting through is the problem but probably not that connection?

This might be a silly question but should I have soldered every single pin on the board or just the ones that seem to be connected to something else on the pcb.

I’ve only soldered the ones with obvious connections.

Sorry if that’s obvious but I’m a total newb with electronics.

Thanks
https://LightGunGamer.com - every Lightgun game and how to play them
Dolphin Emulator

lightgungamer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 57
  • Last login:September 24, 2020, 02:43:28 am
  • I love playing Light Gun Games
    • LightgunGame.com
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #51 on: October 22, 2019, 05:06:43 pm »
I fixed it! I soldered the remaining pins and that fixed it.

Now I’m just having problems with the leds.

It works in terms of calibrating if I use the actual miracle led bar but obviously that doesn’t aim consistently because it has a funny led configuration.

When I switch to the leds that I wired up, I get nothing in terms of the raw input to the serial monitor.

I’m not sure how to test the leds given I can’t see if they should be lit up.

Does anyone know what voltage I should expect to get out of the usb cable?
https://LightGunGamer.com - every Lightgun game and how to play them
Dolphin Emulator

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #52 on: October 22, 2019, 08:06:11 pm »
Many phones and digital cameras can see IR light, so that might help you out. 

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #53 on: October 23, 2019, 05:40:58 am »
@lightgungamer Nice! Hopefully we're almost there. Here's a couple of things to try...

- Like Howard said (thanks by the way) some digital cameras (usually older ones) can see IR light. You should be able to see it as a purple glow through the view finder.

- LED's have a polarity so check you have soldered them the right way round, there should be a flat edge and a round edge. The flat edge should be closest to the SAMCO logo.

- It could also be that the wii sensor is working fine (my after market one from AliExpress works great, but maybe miracle bars are different) and you have either interference (like a window behind your screen or a bulb to close) messing with your signal...

- ...or you're not far enough back. You have to be a fair way back from your screen (about 2.5 screen widths) to reach all corner of the screen. You can test this by pointing at all four corner and making sure your raw values are still ticking over.

Hopefully one of these helps. If not let me know and I can send you over a new sketch to upload and run you though a program called processor that will show you exactly what you camera can see and we can work it out from there. It's a bit involved thou so hopefully one these work :)

Oh, and USB should give you 5V.

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #54 on: October 23, 2019, 09:06:21 am »
I just thought of one other thing. And that's to make sure your camera is up the right way up (apparently some of the stickers on these camera are not quite right). If your camera is installed correctly the red light on your camera should closest to the left wall of your gun when holding it in a shooting position, hopefully that makes sense. Anyway, good luck and let me know how ya go :)

lightgungamer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 57
  • Last login:September 24, 2020, 02:43:28 am
  • I love playing Light Gun Games
    • LightgunGame.com
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #55 on: October 23, 2019, 12:02:06 pm »
Thanks samco.

I tested the power coming from the usb cable and it seems too low so I think it might be a problem with the cable I used.

Did you say that a wii bar should work?  I thought that the multiple leds in the would be an issue?
If not I’ll try that as I have one lying around.

It was the aimtrak bar that I used and it was detecting it but jumping around.
I’m wondering now though if that’s the camera rotation. I think the led power light is at the top.

I just need to wait until I get home to check.

Thanks for the tips. I’m nearly there!

Thanks @howard_casto as well for the tip. My current phone doesn’t seem to detect it but I have an older one that I can try somewhere.


Sent from my iPhone using Tapatalk
https://LightGunGamer.com - every Lightgun game and how to play them
Dolphin Emulator

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #56 on: October 23, 2019, 12:19:20 pm »
I just thought of one other thing. And that's to make sure your camera is up the right way up (apparently some of the stickers on these camera are not quite right). If your camera is installed correctly the red light on your camera should closest to the left wall of your gun when holding it in a shooting position, hopefully that makes sense. Anyway, good luck and let me know how ya go :)
Oh I completely forgot something important, some recent batches of this camera have the camera tilted (manufacturer porblem), so if it works weird with camera in the right orientation, just tilt it 90° left or right, and it should be working.

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #57 on: October 24, 2019, 05:50:25 pm »
Thats great man! Yeah, I've been using this one from aliexpress https://www.aliexpress.com/item/32963414424.html?spm=a2g0s.9042311.0.0.7ce44c4dEOVMFi which only has the 6 leds and it works great. I'm pretty sure most of the proper wii ones have an extra 4 leds but I think they should still work can't confirm thou as I haven't been able to test. From what I can tell I don't think the aimtraks will work thou, due to the different layout of Leds.

Zebra

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 619
  • Last login:August 19, 2021, 01:12:24 pm
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #58 on: October 26, 2019, 06:31:57 pm »
Do you think it would be possible to use an Arduino to make a Guncon 3 work on a Windows PC?

I have been after a solution for this for a while. Someone was able to make one work on a Linux pc by writing custom drivers. How hard would it be to make an Arduino translate Guncon 3 traffic to move a mouse cursor or act as an analog joystick in Windows?


hyo2012

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 70
  • Last login:January 07, 2024, 05:24:10 am
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #59 on: October 27, 2019, 10:29:49 am »
Wow.. handmade custom lightgun! I just ordered component you mentioned.

By the way, I have a question.

Is this lightgun have a off-screen reload function?

Off-screen reload is... when IR camera can't find LED module, pulling trigger act like right mouse click, not left click.


lightgungamer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 57
  • Last login:September 24, 2020, 02:43:28 am
  • I love playing Light Gun Games
    • LightgunGame.com
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #60 on: October 27, 2019, 12:15:10 pm »
Do you think it would be possible to use an Arduino to make a Guncon 3 work on a Windows PC?

I have been after a solution for this for a while. Someone was able to make one work on a Linux pc by writing custom drivers. How hard would it be to make an Arduino translate Guncon 3 traffic to move a mouse cursor or act as an analog joystick in Windows?

Why would you want that? This gun works in a similar way to the gcon 3 anyway and if you wanted, you could put it in the shell.

I’d be more interested in having this emulate the gcon3 outputs so you could use it on the PS3.

I think that’s a difficult thing to do though. I think I remember reading about someone trying to make some Windows drivers for the gcon 3 and they struggled because the traffic was encrypted or something.


Sent from my iPhone using Tapatalk
https://LightGunGamer.com - every Lightgun game and how to play them
Dolphin Emulator

Zebra

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 619
  • Last login:August 19, 2021, 01:12:24 pm
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #61 on: October 27, 2019, 03:15:31 pm »
Do you think it would be possible to use an Arduino to make a Guncon 3 work on a Windows PC?

I have been after a solution for this for a while. Someone was able to make one work on a Linux pc by writing custom drivers. How hard would it be to make an Arduino translate Guncon 3 traffic to move a mouse cursor or act as an analog joystick in Windows?

Why would you want that? This gun works in a similar way to the gcon 3 anyway and if you wanted, you could put it in the shell.

I’d be more interested in having this emulate the gcon3 outputs so you could use it on the PS3.

I think that’s a difficult thing to do though. I think I remember reading about someone trying to make some Windows drivers for the gcon 3 and they struggled because the traffic was encrypted or something.


Sent from my iPhone using Tapatalk

The shell is the very last thing I'd want from a Guncon 3. It's just the only home IR gun I have used that is accurate enough to play shooting games without crosshairs on-screen. As it's a USB device, I have been hoping someone would figure out drivers for Windows.

As I already have two, it would be nice to be able to use them with some Teknoparrot shooters. It kinda sucks that they only work with 3 PS3 games.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #62 on: October 27, 2019, 08:06:49 pm »
What you would probably find is that 98% of that accuracy was in the software and thus unless the driver code was really well written they wouldn't behave like you want them to.  Light gun ports on the wii were fantastic, but playing the same games on the pc with homebrew wiimote drivers.... not so much. 

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #63 on: October 28, 2019, 12:10:25 am »
Do you think it would be possible to use an Arduino to make a Guncon 3 work on a Windows PC?

I have been after a solution for this for a while. Someone was able to make one work on a Linux pc by writing custom drivers. How hard would it be to make an Arduino translate Guncon 3 traffic to move a mouse cursor or act as an analog joystick in Windows?

Why would you want that? This gun works in a similar way to the gcon 3 anyway and if you wanted, you could put it in the shell.

I’d be more interested in having this emulate the gcon3 outputs so you could use it on the PS3.

I think that’s a difficult thing to do though. I think I remember reading about someone trying to make some Windows drivers for the gcon 3 and they struggled because the traffic was encrypted or something.


Sent from my iPhone using Tapatalk
Can't we already do that with RPCS3?

lightgungamer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 57
  • Last login:September 24, 2020, 02:43:28 am
  • I love playing Light Gun Games
    • LightgunGame.com
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #64 on: October 28, 2019, 03:50:26 am »
Do you think it would be possible to use an Arduino to make a Guncon 3 work on a Windows PC?

I have been after a solution for this for a while. Someone was able to make one work on a Linux pc by writing custom drivers. How hard would it be to make an Arduino translate Guncon 3 traffic to move a mouse cursor or act as an analog joystick in Windows?

Why would you want that? This gun works in a similar way to the gcon 3 anyway and if you wanted, you could put it in the shell.

I’d be more interested in having this emulate the gcon3 outputs so you could use it on the PS3.

I think that’s a difficult thing to do though. I think I remember reading about someone trying to make some Windows drivers for the gcon 3 and they struggled because the traffic was encrypted or something.


Sent from my iPhone using Tapatalk
Can't we already do that with RPCS3?

Does rpcs3 have lightgun support?
I haven’t tried it yet.


Sent from my iPhone using Tapatalk
https://LightGunGamer.com - every Lightgun game and how to play them
Dolphin Emulator

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #65 on: October 28, 2019, 04:01:24 am »

Does rpcs3 have lightgun support?
I haven’t tried it yet.

I saw somewhere that it has mouse support, so yes I guess, but I haven't tried it yet either, too busy configuring every game for Mamehooker lately :P

lightgungamer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 57
  • Last login:September 24, 2020, 02:43:28 am
  • I love playing Light Gun Games
    • LightgunGame.com
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #66 on: October 28, 2019, 04:54:17 am »

Does rpcs3 have lightgun support?
I haven’t tried it yet.

I saw somewhere that it has mouse support, so yes I guess, but I haven't tried it yet either, too busy configuring every game for Mamehooker lately :P

I wasn’t sure if it might be difficult if the drivers for the gcon were in the game.
I haven’t been able to run it yet but I’m building a new system that should do it.
I’ll give it a try.
https://LightGunGamer.com - every Lightgun game and how to play them
Dolphin Emulator

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #67 on: October 28, 2019, 05:31:14 am »
@hyo2012 Awesome! I love to know how you go. Currently pointing off screen is setup to move the mouse to it's extreme co-ordinates when it cant see any leds (i.e. you've pointed off screen) and then you can shoot to reload as this was how all of the emulators/games that I've tried re-load system works. But I could write an alternative sketch that also makes the right mouse button click if need it. Just let me know if ya do.

@Zebra I haven't actually played with a GunCon 3 so I don't have any idea to be honest. But lucky if looks like you'll get some help here anyway :)

Zebra

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 619
  • Last login:August 19, 2021, 01:12:24 pm
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #68 on: October 28, 2019, 05:41:06 pm »
What you would probably find is that 98% of that accuracy was in the software and thus unless the driver code was really well written they wouldn't behave like you want them to.  Light gun ports on the wii were fantastic, but playing the same games on the pc with homebrew wiimote drivers.... not so much.

That seems to be true with real light guns on consoles. Someone created patches to allow you to use a Namco Guncon 1 on games that only had support for Konami's Hyperblaster and the accuracy remained poor. It was nowhere near the performance when using the same gun on Time Crisis.

On the other hand, you get terrible accuracy with most 3rd party light guns on the PS2 but excellent accuracy when playing the same game with an official Namco gun. So, the gun hardware definitely matters. People also claimed huge differences between act labs accuracy and those Lik Sang guns they competed with.

I thought it was different with PC emulators though as they all seem to map gun controls to either a standard mouse or analog joystick. PC guns like Aimtraks, Act Labs and USB2GUN boards all act as a standard mouse or analog joystick so they are usually equally accurate for all games. If a good job was done on the Windows drivers, would this not also be the case for a Guncon 3?

I've only used a Wii remote on a Wii but they are never accurate enough to use without crosshairs on-screen. It's hard to say if Namco would have been able to make a Wii remote work as well as a GC3 for Time Crisis 4. I think there is a hardware limitation in there somewhere that prevents it though. The Wii remote performs poorly on all Wii light gun game ports.

pbj

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 10871
  • Last login:Yesterday at 11:58:22 pm
  • Obey.
    • The Chris Burke Band
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #69 on: October 28, 2019, 06:03:05 pm »
Guns worked well on the Wii games that were designed around being on the Wii.  Big Buck Hunter was actually pretty damn fun.


Zebra

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 619
  • Last login:August 19, 2021, 01:12:24 pm
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #70 on: October 29, 2019, 01:41:35 pm »
Guns worked well on the Wii games that were designed around being on the Wii.  Big Buck Hunter was actually pretty damn fun.



They work OK if you play with crosshairs on-screen but accuracy is not required for that. It's fine for a lot of people but, for some reason, I find it hard to enjoy shooting games with crosshairs on-screen if the original arcade didn't have them. It just makes them too easy and it feels like I'm using a mouse instead of a gun. It's why I don't like using my Aimtrak to play Time Crisis in mame.

It's a shame because the Wii is the only console for a bunch of arcade shooters. I know of no other way to play games like Terraburst and Op Thunder Hurricane or Ghost Squad.

The PS3 has a bunch of gun games too but most of them use the PS Move which is only a little better than the Wii remote. A lot of it's games would have been worth playing if they would have added an option to use a Guncon 3. The key difference in the hardware seems to be that it uses two led clusters instead of one and they are spaced further apart.




Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #71 on: October 29, 2019, 01:52:04 pm »
I'm talking about arcade game ports that were released on the wii, not wii exclusive games.  The sega ones in particular.... if you calibrated in-game every time you played and didn't move around (in other words stand in the same spot) the accuracy was great... no cross hairs needed.  It wasn't the wii or it's OS software that increased the in-game accuracy, but rather the game's calibration code.  The reason wiimote games worked great on most first party Nintendo titles and the major developers that actually took the time to make good ports is because there was custom code made for each individual game to translate the mess of sensor data the wiimote fed back into good tracking. 

The reason homebrew drivers don't work well is because they typically just take the ir tracking data, bind that to a mouse axis and that's it.  If done correctly it should be far more complex. 

Zebra

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 619
  • Last login:August 19, 2021, 01:12:24 pm
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #72 on: October 29, 2019, 03:19:56 pm »
I'm talking about arcade game ports that were released on the wii, not wii exclusive games.  The sega ones in particular.... if you calibrated in-game every time you played and didn't move around (in other words stand in the same spot) the accuracy was great... no cross hairs needed.  It wasn't the wii or it's OS software that increased the in-game accuracy, but rather the game's calibration code.  The reason wiimote games worked great on most first party Nintendo titles and the major developers that actually took the time to make good ports is because there was custom code made for each individual game to translate the mess of sensor data the wiimote fed back into good tracking. 

The reason homebrew drivers don't work well is because they typically just take the ir tracking data, bind that to a mouse axis and that's it.  If done correctly it should be far more complex.

OK you've peaked my interest in trying again with my Wii. I gave up on it after trying the House of the Dead games, Ghost Squad and Mad Dog McCree. Which disc would you recommend for me to try (to shoot without crosshairs). I have a bunch of ideas for a custom Wii arcade gun if I can find some games to make it worth the time.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #73 on: October 29, 2019, 03:55:10 pm »
I remember Ghost Squad being particularly good... it's really short though.  HOTD OK also worked well with the wiimote.  If you didn't find the accuracy acceptable then it might just be you never are. 

Zebra

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 619
  • Last login:August 19, 2021, 01:12:24 pm
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #74 on: October 30, 2019, 01:45:43 pm »
Were you able to play Ghost Squad on the Wii without crosshairs? I couldn't find that option. I'm going to dig out my Wii and take another look.

My problem is that I'm spoiled by the PS1 and PS2 Guncon games. I was playing Virtua Cop 1 and 2 on the PS2 yesterday and it was pure magic. With the official Namco Guncon 2 in an arcade recoil gun shell it felt just like I was playing the coin-op. Every shot landed exactly where I aimed etc. I wish I could use that gun for all shooting games.

Still, it looks like we won't have to wait too long before we get an arcade-accurate home IR gun. Between the commercial projects like Sinden and the various diy projects I'm sure one if them will deliver. I want to try the 4 sensor diy design. If it works well, I could use it with a Wii emulator.

On a separate note, I noticed yesterday that the Raw ThrillS Terminator Salvation IR gun doesn't appear to use a separate I/O board like other arcade guns. The gun camera and all ten sensor boards run directly to the PC via a USB harness. The recoil is handled by a small "kick board" inside the gun shell and that also connects to the USB harness. Would it be possible to make the diy Samco gun without an Arduino and just run the code on the PC instead like the Raw Thrills gun?

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #75 on: October 30, 2019, 04:22:13 pm »
There's no option to turn it off.... I believe it even had cross hairs in the arcades due to how the game worked.... I just meant you could point and shoot without having to rely on it. 

As for all the new options on the way I hope they turn out ok, but I'll believe it when I have them in my hand. 

Zebra

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 619
  • Last login:August 19, 2021, 01:12:24 pm
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #76 on: October 30, 2019, 08:39:45 pm »
There's no option to turn it off.... I believe it even had cross hairs in the arcades due to how the game worked.... I just meant you could point and shoot without having to rely on it. 

As for all the new options on the way I hope they turn out ok, but I'll believe it when I have them in my hand.

I feel the same. Manufacturers always claim that their gun controllers have unprecedented accuracy regardless if they are pin point or if you couldn't hit a bus with one. They often claim to be "arcade quality" too but when you get them in hand, you usually find yourself wondering if they have ever actually been to an arcade. It's getting hard to trust what they say.

To date there has only been two or three accurate home guns and none that are both accurate and arcade quality at the same time (without a diy transplant to an arcade gun shell).

Luckily for us there are still some trusting people who are prepared to be first adopters of the new guns based only on the manufacturers sales pitch. I'll wait to see what they have to say first. They are like the first penguin to jump through the ice into the ocean. The one that gets eaten by a seal but clears the path for the rest of the penguins. Never be the first penguin!




hyo2012

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 70
  • Last login:January 07, 2024, 05:24:10 am
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #77 on: October 30, 2019, 10:54:33 pm »
Were you able to play Ghost Squad on the Wii without crosshairs? I couldn't find that option. I'm going to dig out my Wii and take another look.

My problem is that I'm spoiled by the PS1 and PS2 Guncon games. I was playing Virtua Cop 1 and 2 on the PS2 yesterday and it was pure magic. With the official Namco Guncon 2 in an arcade recoil gun shell it felt just like I was playing the coin-op. Every shot landed exactly where I aimed etc. I wish I could use that gun for all shooting games.

Still, it looks like we won't have to wait too long before we get an arcade-accurate home IR gun. Between the commercial projects like Sinden and the various diy projects I'm sure one if them will deliver. I want to try the 4 sensor diy design. If it works well, I could use it with a Wii emulator.

On a separate note, I noticed yesterday that the Raw ThrillS Terminator Salvation IR gun doesn't appear to use a separate I/O board like other arcade guns. The gun camera and all ten sensor boards run directly to the PC via a USB harness. The recoil is handled by a small "kick board" inside the gun shell and that also connects to the USB harness. Would it be possible to make the diy Samco gun without an Arduino and just run the code on the PC instead like the Raw Thrills gun?

You can remove CrossHair on Ghost Squad Wii version by this way.

Game on -> Arcade -> Customize -> Aim Reticle off

 ;)

Zebra

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 619
  • Last login:August 19, 2021, 01:12:24 pm
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #78 on: November 03, 2019, 05:53:02 pm »
The wii version actually looks fairly playable on the Dolphin emulator:



Maybe I can leave my Wii packed up in a box somewhere and just play it's gun games on my PC with my preferred gun tech. I kinda like the original Ghost Squad arcade guns but used ones are still a bit pricey on ebay. Still, Ghost Squad has to be played with a machine gun so I might have to pony up for a cab.

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #79 on: December 07, 2019, 12:47:31 am »
Hi Guys,

Just a quick update. I've added a test sketch to my GitHUb so anyone can test there gun is setup corectly before they upload the final code. Here's a short video on how it works.


samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #80 on: March 19, 2020, 12:56:28 am »
Hi Guys, it's been a while but I finally got around to updated my PCB boards to work with the ItsyBitsy 32u4 and probably more exciting than that I've also now got a new GunCon2 compatible board. Anyway here's a link to my new vid if you want to check them out.

Cheers Sam(co)


pepeporras

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:June 03, 2020, 12:05:22 pm
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #81 on: March 21, 2020, 12:28:28 am »
Hi Samco, i have connected two guncon2 on my PC, no sensor bar, really lightgun 

« Last Edit: March 21, 2020, 04:15:51 pm by pepeporras »

pepeporras

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:June 03, 2020, 12:05:22 pm
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #82 on: March 21, 2020, 08:54:11 am »
How to insert YouTube videos?

nipsmg

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1737
  • Last login:Today at 06:52:26 am
  • ROONEY!! ERRGH!!
    • Arcadia
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #83 on: March 21, 2020, 10:12:41 am »
Hi Samco, i have connected two guncon2 on my PC, no sensor bar, really lightgun  ;)

[youtube]http://www.youtube.com/watch?v=IxpMHORxmcQ[/youtube]

put the url without any tags.. no URL tag, no youtube tag, just the bare url. see:


Foxhole

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 287
  • Last login:March 04, 2024, 04:36:28 pm
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #84 on: March 21, 2020, 12:31:28 pm »
Hi Samco, i have connected two guncon2 on my PC, no sensor bar, really lightgun  ;)

[youtube]http://www.youtube.com/watch?v=IxpMHORxmcQ[/youtube]
Pepe, how are you using those guns on the pc? Ems topgun driver?

pepeporras

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:June 03, 2020, 12:05:22 pm
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #85 on: March 21, 2020, 04:17:26 pm »
Hi Samco, i have connected two guncon2 on my PC, no sensor bar, really lightgun  ;)

[youtube]http://www.youtube.com/watch?v=IxpMHORxmcQ[/youtube]

put the url without any tags.. no URL tag, no youtube tag, just the bare url. see:


Thanks bro  :notworthy:

pepeporras

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:June 03, 2020, 12:05:22 pm
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #86 on: March 21, 2020, 04:28:34 pm »

Pepe, how are you using those guns on the pc? Ems topgun driver?

hello, yes, for the guncon2 use that driver but only with that driver it does not work well, I have created a code to flash the screen when shooting and another to delay the shot so that it enters the flash so that it detects the position well.

I am not going to talk about this here anymore, that this topic is from Samco, if someone wants to know more about this, speak to me privately or I will open a new topic if someone wants.

By the way Samco, your system is wonderful, as soon as the alarm passes, I will buy a couple of PCBs from their ebay store to test my LCD.

good job :applaud:

lightgungamer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 57
  • Last login:September 24, 2020, 02:43:28 am
  • I love playing Light Gun Games
    • LightgunGame.com
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #87 on: March 21, 2020, 05:06:32 pm »

Pepe, how are you using those guns on the pc? Ems topgun driver?

hello, yes, for the guncon2 use that driver but only with that driver it does not work well, I have created a code to flash the screen when shooting and another to delay the shot so that it enters the flash so that it detects the position well.

I am not going to talk about this here anymore, that this topic is from Samco, if someone wants to know more about this, speak to me privately or I will open a new topic if someone wants.

By the way Samco, your system is wonderful, as soon as the alarm passes, I will buy a couple of PCBs from their ebay store to test my LCD.

good job :applaud:
Hey, I’d love to know more about this. How are you making it work?

It would be great if you wanted to start a thread or pm me if you don’t want to.
Thanks.


Sent from my iPhone using Tapatalk
https://LightGunGamer.com - every Lightgun game and how to play them
Dolphin Emulator

Foxhole

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 287
  • Last login:March 04, 2024, 04:36:28 pm
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #88 on: March 21, 2020, 06:02:14 pm »

Pepe, how are you using those guns on the pc? Ems topgun driver?

I am not going to talk about this here anymore, that this topic is from Samco, if someone wants to know more about this, speak to me privately or I will open a new topic if someone wants.
True, sorry, samco, sent you a pm, pepe.

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #89 on: March 24, 2020, 11:45:10 pm »
Thanks Pepe! Your setup looks sweet, nice work!

Yeah, won’t be able to send out any PCBs for a while all inessential businesses have been suspended here in NZ for at least a month so had to shut down my eBay listing for now.

Stay safe out the peps, at least we now have more time for projects :)

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #90 on: May 01, 2020, 12:27:40 am »
Hi Guys,

Just a quick update, I've started selling my PCB's again...

https://www.ebay.com.au/usr/samcocontrollers

... and have made a 4 LED sketch (just encase you missed it) :)


lightgungamer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 57
  • Last login:September 24, 2020, 02:43:28 am
  • I love playing Light Gun Games
    • LightgunGame.com
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #91 on: May 01, 2020, 03:21:29 am »
Hey samco, this looks great.

Do the 4 leds help keep the system accurate if you change position relative to the screen like side to side or stand up etc?

Doing that would require you to recalibrate the aimtrak for example.
https://LightGunGamer.com - every Lightgun game and how to play them
Dolphin Emulator

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #92 on: May 01, 2020, 07:10:56 pm »
Hi Lightgungamer,

Yeah, currently definitely works better if you play from the position you calibrated so similar to Aimtrak. But I have an idea of how to add perspective correction that I'll start working on next week which could fix that. I'll let ya know how I go.

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #93 on: May 24, 2020, 01:54:31 am »
Hi Guys,

Just ironed out a few bugs in my 4 LED code and updated my GitHub. If anyone wants to try it out and let me know what they think I’d appreciate it.

Cheers Sam(co)

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #94 on: June 18, 2020, 01:32:31 am »
Hey Guys, just uploaded my GunCon2 vid...


Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #95 on: June 18, 2020, 01:43:44 pm »
So do we have a running total for the parts list now?  Been thinking of building one since the sinden gun keeps getting delayed. 

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #96 on: June 18, 2020, 09:48:25 pm »
Hi Howard,

GunCon2's vary quite a bit but lets say $40US for the sake of argument. DF Robot IR Positioning Cameras are $23.55US + postage on there website, the cheapest ItsyBitsy you can get is $9.95US + postage and my PCB's are $10US + $3US postage. You might be able to save a little on potage by getting the Camera & ItsyBitsy board from a maker website so a safe estimate would be a little under $90US (+ postage) it you had to buy all the parts. Obviously you can save quite bit if you have an old GunCon2 floating around or can find one cheap :)

https://www.dfrobot.com/product-1088
https://www.adafruit.com/product/3677
https://www.ebay.com/itm/184265539060

Cheers Sam(co)

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #97 on: June 19, 2020, 03:14:04 am »
Thanks for the reply.  I was actually thinking of making a custom 3d printed enclosure.  I'm not sure though.... that might not be worth the effort. 

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #98 on: June 20, 2020, 08:02:30 pm »
Yeah, that would be cool! But a lot of work :) If you're building your own Gun then you wouldn't need a PCB and could use any 32u4 board you like so the only so the only real cost would be the IR positioning camera. So be quite a bit cheaper but a lot more work. Cool idea though I'd love to know how ya go.

LightFun

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 10
  • Last login:December 26, 2021, 12:09:56 pm
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #99 on: June 21, 2020, 09:13:34 am »
Hey Guys, just uploaded my GunCon2 vid...


Noticed this pop up on my YouTube feed a few days ago. I look forward to watching, your first video was great.

hyo2012

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 70
  • Last login:January 07, 2024, 05:24:10 am
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #100 on: June 28, 2020, 05:05:07 am »
I succeeded in make Samco 4IR light gun.
Strange thing is I have to rotate IR Camera about 90 degree to work correctly.
And works properly, that was amazing.
Compared to Aimtrak lightgun I used, Samco 4IR light gun's working distance that monitor from light gun is decreased. So playing gun game is more fun :laugh:

I have a suggestion.
When I use light gun, other mouse is not movable. To use mouse, I have to push calibration button on light gun.
It is better I think, if light gun can't see IR light, stop working with out pushing calibration button.
And.. Is it possible add fuction 'offscreen trigger reload'?

Thank for your works. I ordered 3unit of guncon2 pcb from your ebay ;D
« Last Edit: June 28, 2020, 05:13:41 am by hyo2012 »

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #101 on: June 30, 2020, 10:37:07 pm »
Thanks, for the feedback @hyo2012. I'm glad you like it :)

Yeah, apparently a bunch of the DF Robot camera had the labels stuck on the incorrectly it's a real common problem. Glad you worked it out.

I'm a bit busy with other stuff at the moment but I'll have a look into your suggestions when I get some spare time and let ya know how I go. Out of curiosity which game are you playing that you would like to add the offscreen trigger reload?

Cheers Sam(co)

hyo2012

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 70
  • Last login:January 07, 2024, 05:24:10 am
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #102 on: July 01, 2020, 02:11:17 am »
Thanks, for the feedback @hyo2012. I'm glad you like it :)

Yeah, apparently a bunch of the DF Robot camera had the labels stuck on the incorrectly it's a real common problem. Glad you worked it out.

I'm a bit busy with other stuff at the moment but I'll have a look into your suggestions when I get some spare time and let ya know how I go. Out of curiosity which game are you playing that you would like to add the offscreen trigger reload?

Cheers Sam(co)

most of demul lightgun games - hotd 2, confidential mission, maze of kings... 

As I know, these sega arcade gun games are support offscreen reload on original arcade cabinet.

judokan

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 7
  • Last login:January 06, 2024, 01:50:06 pm
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #103 on: September 04, 2020, 10:21:28 am »
Hello, I´m from spain (murcia), I have bought 2 motherboards from ebay, I already have everything else, I have assembled it to test it and it does not work with the Adafruit ItsyBitsy 32u4 5v the pins is different for 5v.
« Last Edit: September 05, 2020, 07:52:19 am by judokan »

judokan

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 7
  • Last login:January 06, 2024, 01:50:06 pm
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #104 on: September 10, 2020, 05:22:14 pm »
Arduino:1.8.13 (Windows 7), Tarjeta:"Adafruit ItsyBitsy 32u4 5V 16MHz"

libraries\Samco_4IR\AbsMouse.cpp.o (symbol from plugin): In function `AbsMouse_::AbsMouse_()':

(.text+0x0): multiple definition of `AbsMouse_::AbsMouse_()'

libraries\Samco_2IR\AbsMouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Samco_4IR\AbsMouse.cpp.o (symbol from plugin): In function `AbsMouse_::AbsMouse_()':

(.text+0x0): multiple definition of `AbsMouse_::AbsMouse_()'

libraries\Samco_2IR\AbsMouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Samco_4IR\AbsMouse.cpp.o (symbol from plugin): In function `AbsMouse_::AbsMouse_()':

(.text+0x0): multiple definition of `AbsMouse_::init(unsigned int, unsigned int, bool)'

libraries\Samco_2IR\AbsMouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Samco_4IR\AbsMouse.cpp.o (symbol from plugin): In function `AbsMouse_::AbsMouse_()':

(.text+0x0): multiple definition of `AbsMouse_::report()'

libraries\Samco_2IR\AbsMouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Samco_4IR\AbsMouse.cpp.o (symbol from plugin): In function `AbsMouse_::AbsMouse_()':

(.text+0x0): multiple definition of `AbsMouse_::move(unsigned int, unsigned int)'

libraries\Samco_2IR\AbsMouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Samco_4IR\AbsMouse.cpp.o (symbol from plugin): In function `AbsMouse_::AbsMouse_()':

(.text+0x0): multiple definition of `AbsMouse_::press(unsigned char)'

libraries\Samco_2IR\AbsMouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Samco_4IR\AbsMouse.cpp.o (symbol from plugin): In function `AbsMouse_::AbsMouse_()':

(.text+0x0): multiple definition of `AbsMouse_::release(unsigned char)'

libraries\Samco_2IR\AbsMouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Samco_4IR\AbsMouse.cpp.o (symbol from plugin): In function `AbsMouse_::AbsMouse_()':

(.text+0x0): multiple definition of `AbsMouse'

libraries\Samco_2IR\AbsMouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Samco_4IR\DFRobotIRPosition.cpp.o (symbol from plugin): In function `DFRobotIRPosition::DFRobotIRPosition()':

(.text+0x0): multiple definition of `DFRobotIRPosition::DFRobotIRPosition()'

libraries\Samco_2IR\DFRobotIRPosition.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Samco_4IR\DFRobotIRPosition.cpp.o (symbol from plugin): In function `DFRobotIRPosition::DFRobotIRPosition()':

(.text+0x0): multiple definition of `DFRobotIRPosition::DFRobotIRPosition()'

libraries\Samco_2IR\DFRobotIRPosition.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Samco_4IR\DFRobotIRPosition.cpp.o (symbol from plugin): In function `DFRobotIRPosition::DFRobotIRPosition()':

(.text+0x0): multiple definition of `DFRobotIRPosition::~DFRobotIRPosition()'

libraries\Samco_2IR\DFRobotIRPosition.cpp.o (symbol from plugin):(.text+0x0): first defined here

Se encontraron varias bibliotecas para "Wire.h"

libraries\Samco_4IR\DFRobotIRPosition.cpp.o (symbol from plugin): In function `DFRobotIRPosition::DFRobotIRPosition()':

Usado: C:\Users\usuario\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.13\libraries\Wire

 No usado: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire

(.text+0x0): multiple definition of `DFRobotIRPosition::~DFRobotIRPosition()'

Se encontraron varias bibliotecas para "AbsMouse.h"

libraries\Samco_2IR\DFRobotIRPosition.cpp.o (symbol from plugin):(.text+0x0): first defined here

Usado: C:\Program Files (x86)\Arduino\libraries\Samco_2IR

 No usado: C:\Program Files (x86)\Arduino\libraries\Samco_4IR

libraries\Samco_4IR\DFRobotIRPosition.cpp.o (symbol from plugin): In function `DFRobotIRPosition::DFRobotIRPosition()':

(.text+0x0): multiple definition of `DFRobotIRPosition::requestPosition()'

libraries\Samco_2IR\DFRobotIRPosition.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Samco_4IR\DFRobotIRPosition.cpp.o (symbol from plugin): In function `DFRobotIRPosition::DFRobotIRPosition()':

(.text+0x0): multiple definition of `DFRobotIRPosition::readX(int)'

libraries\Samco_2IR\DFRobotIRPosition.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Samco_4IR\DFRobotIRPosition.cpp.o (symbol from plugin): In function `DFRobotIRPosition::DFRobotIRPosition()':

(.text+0x0): multiple definition of `DFRobotIRPosition::readY(int)'

libraries\Samco_2IR\DFRobotIRPosition.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Samco_4IR\DFRobotIRPosition.cpp.o (symbol from plugin): In function `DFRobotIRPosition::DFRobotIRPosition()':

(.text+0x0): multiple definition of `DFRobotIRPosition::writeTwoIICByte(unsigned char, unsigned char)'

libraries\Samco_2IR\DFRobotIRPosition.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Samco_4IR\DFRobotIRPosition.cpp.o (symbol from plugin): In function `DFRobotIRPosition::DFRobotIRPosition()':

(.text+0x0): multiple definition of `DFRobotIRPosition::begin()'

libraries\Samco_2IR\DFRobotIRPosition.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Samco_4IR\DFRobotIRPosition.cpp.o (symbol from plugin): In function `DFRobotIRPosition::DFRobotIRPosition()':

(.text+0x0): multiple definition of `DFRobotIRPosition::available()'

libraries\Samco_2IR\DFRobotIRPosition.cpp.o (symbol from plugin):(.text+0x0): first defined here

collect2.exe: error: ld returned 1 exit status

exit status 1

Error compilando para la tarjeta Adafruit ItsyBitsy 32u4 5V 16MHz.



Este informe podría contener más información con
"Mostrar salida detallada durante la compilación"
opción habilitada en Archivo -> Preferencias.

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #105 on: September 10, 2020, 06:20:45 pm »
Hi judokan, this might be caused by having an extra library in your libraries folder. Try and remove the AbMouse library and DFRobot Library if you have it as a stand alone libraries and only put one of the Samco libraries (either Samco_2IR or Samco_4IR) in your libraries folder.

Cheers Sam(co)

tomton

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 39
  • Last login:April 18, 2023, 07:38:30 am
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #106 on: September 23, 2020, 04:23:23 am »
Hi Samco,

This project is great! As soon as I saw it I started sourcing all the elements and finally was able to put it all together last night.
Uploaded your sketch successfully and new HID device appeared in the Device Manager (windows) but I don't see any output in the serial monitor window.

I have tried reuploading your sketch, restarting my PC and a few other things but no luck.

I have attached screenshot showing what I see after uploading your code.

Have you got any idea what could it be?


Thanks in advance,
Tom

kim_sama_999

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:March 19, 2024, 05:04:15 am
  • SHOTA NATION
    • YouTube
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #107 on: September 23, 2020, 07:41:47 am »
Awesome work  8) !!! I bought the pieces and the PCB to try out. I really like the 2 sensor bar option which makes the gun work better. If I have good luck with making it I would buy the new pieces and PCB and put it in a Namco arcade gun shell  ;D
YouTube: @KimSamaVideos

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #108 on: September 26, 2020, 07:55:51 pm »
Hi tomton, sorry for the late reply. Sometimes with the ItsyBitsy the Com Port can change when you upload a sketch so you could try changing your COM port before running the serial monitor. Opening the serial monitor is mainly just to check the sketch is running properly so alternatively you could just try and calibrate with it closed. Hope this helps let me know how ya go.

tomton

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 39
  • Last login:April 18, 2023, 07:38:30 am
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #109 on: September 27, 2020, 05:17:39 pm »
Hi Samco,

Thanks for your reply.

I have spent more time with this today and tried to upload your sketch to Arduino nano and this produced loads of errors saying "error: 'AbsMouse' was not declared in this scope"
Weirdly I don't get those errors when uploading to ItsyBitsy  :dunno . I have tried redownloading AbsMouse but still getting those errors.

I have tried doing this on another PC but still no luck...   :banghead:

Any idea?

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #110 on: September 28, 2020, 08:16:44 am »
Hi Samco,

Thanks for your reply.

I have spent more time with this today and tried to upload your sketch to Arduino nano and this produced loads of errors saying "error: 'AbsMouse' was not declared in this scope"
Weirdly I don't get those errors when uploading to ItsyBitsy  :dunno . I have tried redownloading AbsMouse but still getting those errors.

I have tried doing this on another PC but still no luck...   :banghead:

Any idea?
I don't think the absmouse is compatible with nano?
But it might be possible to fix that by manually modifying the library.

tomton

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 39
  • Last login:April 18, 2023, 07:38:30 am
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #111 on: September 28, 2020, 05:48:37 pm »
To me it looks like there is no communication between ItsyBitsy and PC.

I have now uploaded "Test" sketch to ItsyBitsy and used it with "Processing" but I got all red buttons so as suggested I have tried different port numbers from 1 to 10 but "Processing" just keeps crashing saying
Code: [Select]
COM1 COM5
ArrayIndexOutOfBoundsException: "port number that I have tried"

I think I'm either doing something very wrong or I'm using wrong board for this. Below link to the board that I'm using.
https://www.ebay.co.uk/itm/Adafruit-Itsy-Bitsy-32u4-5V-16MHz/142656639851?hash=item2136ff936b:g:aBkAAOSwQwZaXF5a

Any suggestions or help would be appreciated.

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #112 on: September 29, 2020, 08:14:46 pm »
Yeah, JayBee is correct. The nano is not compatible with the absmouse library. But the link to the board is the right board.

When you upload test sketch do you get anything over the serial monitor?

If not try this simple sketch that will just repeat "Hello world" in the serial monitor...

void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println("Hello world");
delay(1000);
}

Just to confirm that serial is working.

tomton

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 39
  • Last login:April 18, 2023, 07:38:30 am
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #113 on: October 01, 2020, 04:54:06 am »
I should have said it earlier but I have tested my ItsyBitsy board with similar piece of code to yours and serial output worked fine.

I finally got it working last night! Long story short my board for some reason was unable to provide 5V to the IR camera on pin5, under load it dropped to ~0.7V. When I wired camera directly to 5V supply the red LED lit on and tbh until then I didn't know it should be on :o . I have then wired IR camera positive directly to 5V pin on the board and it now works. Along the way it also turned out that on my camera SCL/SDA were the other way round (Green is SDA and Yellow is SCL).

It works but still no shooting for me as I can't get it calibrated. Could be my dual monitor setup or Wii bar that I'm using which has more than two IR LEDs

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #114 on: October 01, 2020, 08:47:30 am »
I should have said it earlier but I have tested my ItsyBitsy board with similar piece of code to yours and serial output worked fine.

I finally got it working last night! Long story short my board for some reason was unable to provide 5V to the IR camera on pin5, under load it dropped to ~0.7V. When I wired camera directly to 5V supply the red LED lit on and tbh until then I didn't know it should be on :o . I have then wired IR camera positive directly to 5V pin on the board and it now works. Along the way it also turned out that on my camera SCL/SDA were the other way round (Green is SDA and Yellow is SCL).

It works but still no shooting for me as I can't get it calibrated. Could be my dual monitor setup or Wii bar that I'm using which has more than two IR LEDs
Ah yes, some boards simply don't have enough current available through the digital pins to power the cam.
I always recommended to power i2c devices through either 5v or 3v3 power pins (depending of the device specs).

For the calibration not working properly, have you check the cam orientation? I know most dfrobot cams have the up sticker on the wrong side (up sticker should be on the side, not up).
I'd suggest adjusting it manually with the test processing app, because sometimes it's not even aligned correctly with the sticker.

tomton

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 39
  • Last login:April 18, 2023, 07:38:30 am
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #115 on: October 01, 2020, 10:45:45 am »
Camera is definitely facing correct way up and cursor follows gun movement left/right/up/down but I can't get it to screen corners to calibrate. If I just calibrate it with area that is accessible it then works fine in small "window" on screen and once I move out of this "window" cursor just jumps randomly all over the place. I'm guessing this is because it's not calibrated correctly.

I will give it another go tonight.

killthefreeman

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 1
  • Last login:November 02, 2020, 07:39:12 pm
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #116 on: October 06, 2020, 06:22:32 am »
Hi Samco,
First, i would like to thank you for your project.
I just wanted to know if it is possible to use the gun in flycast (within retroarch) with house of the dead 2?
Thanks.

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #117 on: October 11, 2020, 10:26:15 pm »
@tomton, sorry again for the late reply. How did you go? Maybe try and calibrate from a bit further back you want be about 2 /12 screen widths back for the 2 led sketch and 1 1/2 for the 4 led sketch.

@killthefreeman Thanks man :) I haven't tested that emulator myself but I have seen videos of people using it with an AimTrak which works in similar way so if you can find a guide for AimTrak you should be able to get it going. I'll try and do a test when I get some spare time.

tomton

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 39
  • Last login:April 18, 2023, 07:38:30 am
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #118 on: October 14, 2020, 04:37:12 am »
Thanks for all the help guys! I've got it working now  :)
I have used test sketch to align IR camera perfectly and then moved further back to calibrate.
It works fine but because it doesn't like dual monitor setup I will not be adding it to my MAME cabinet (I have main display and marquee monitor connected).
If i was to add it I would look into adding an LED to indicate when the gun is active or when it is in calibration mode.

EDIT:
I was just looking at your code and was wondering if it would be possible to define light gun calibration/work area independently to screen/desktop resolution.
For example i have 2x 1920x1080 monitors side by side which makes my desktop 3840x1080 but all emulators I use utilize only one screen so would it be possible to limit light gun to only work on one monitor by somehow offsetting/limiting it?
« Last Edit: October 14, 2020, 06:27:59 am by tomton »

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #119 on: June 10, 2021, 11:22:28 pm »
Hi Guys, just a quick update for anyone out there still using a SAMCO. Have just updated my code to have saved calibration & increased acuuracy. Get out the my new vid...


Owillingham

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 3
  • Last login:July 06, 2021, 09:59:29 am
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #120 on: June 20, 2021, 09:13:40 am »
Any schematics for including recoil on the Samco lightgun?  have parts on order to build the Samco gun, but would be nice to include recoil at the same time of building.

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #121 on: June 21, 2021, 12:20:17 am »
Hi, think I already answered this on facebook. But yeah, have schematics available on my GitHub (for ItsyBitsy but should be easy enough to adapt to other boards and can already change Pin assignments in code if you need to). Recoil is still a work in progress so no documentation yet.

Dam0

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:July 07, 2023, 06:50:40 am
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #122 on: August 04, 2021, 03:51:06 am »
SAMCO, after many months of leaving your 1.0 arduino kit on the shelf, i finally re-plugged the gun in and it works flawlessly....

so thanks for all your hard work, now to gather the light-gun games i got into a single frontend.

i "think" my issue in the end was i was standing too close buy about a good metre maybe more. so all up, for a 24" screen i recon id be 5-6 foot away from the screen for the cursor to operate properly.

i kinda thought on it a bit in hindsight, that after reading about some ppl using lenses on their gun4ir setups to reduce the focal length makes some sense .

anyhow, thanks for your hard work . very happy i waited this time, before i cracked a poopy pants

Prow

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 11
  • Last login:Yesterday at 09:46:56 am
  • I'm here for Light Guns
    • github.com/Prow7/ir-light-gun
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #123 on: August 07, 2021, 01:06:48 pm »
I made an enhanced version of the SAMCO project. The enhancements are:
  • Increased precision for maths and mouse pointer position
  • Glitch-free DFRobot positioning (DFRobotIRPositionEx library)
  • IR camera sensitivity adjustment (DFRobotIRPositionEx library)
  • Optional averaging modes can be enabled to slightly reduce mouse position jitter
  • Enhanced button debouncing and handling (LightgunButtons library)
  • Modified AbsMouse to be a 5 button device (AbsMouse5 library)
  • Multiple calibration profiles
  • Save settings and calibration profiles to flash memory (SAMD) or EEPROM (ATmega32U4)
  • Built in Processing mode for use with the SAMCO Processing sketch

Much of the code was re-worked but the positioning math calculation is all from SAMCO. It is fantastic how well this works!

One big change is with the button handling code that allows button combinations. For example, you can assign a button combination to enter pause mode that you will never press while playing a game so the reload button can be assigned a mouse button or key press.

The other big enhancement is the calibration profiles. I found myself sometimes wanting to play on my big screen TV and other times on my monitor. Combine that with 4:3 aspect ratio games requiring different calibration data, adding multiple profiles is an obvious solution. While the calibration procedure is simple, it's even faster to just press a button to select a profile.

Support for the ATmega32U4 boards was a bit of a last minute addition and not as well tested, but it should work (though I haven't tested saving to EEPROM).

The buttons in the sketch are configured for a SAMCO 2.0 GunCon 2 build. If your gun has different button pin assignments then you will have to modify the sketch.

You can get the source code from: https://github.com/Prow7/ir-light-gun
See the readme files on GitHub for more details.

Big thanks to Samco for this project. Your custom PCB made it super easy to mod a GunCon 2! Also thanks to Gustavo for his Apexel lens adapter models. A fantastic solution to the less than ideal narrow FOV that the camera has.

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #124 on: August 08, 2021, 08:48:13 pm »
Wow, this is awesome Prow! I was hoping that a gun coder would get their hands on my code at some stage.

Haven't got a spare SAMD board to try it out yet but just looking through your code, I'm super impressed. Can't wait to try it out!

Cheers Sam(co)

ThatOneSeong

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 63
  • Last login:Yesterday at 11:48:38 pm
  • Just your average Seong.
    • Twitter
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #125 on: September 11, 2021, 07:00:01 pm »
Hiya!New face peeking in to say thanks, because this project's given me the perfect inspiration to get and mod a GCon 2 for myself. Would be the first good lightgun solution I've found that isn't in some desolate theater arcade.

Had a few asks, though:
  • How accurate is the SAMCO compared to other solutions? And for anyone who's used it, how is the performance any different with @Prow's enhanced fork? I feel like that may as well be the version I use whenever I get around to building this.
  • From what I can tell, the Gun4IR seems to be scarily similar to SAMCO, down to using the same board and camera, but I'm curious what the differences are between the two. For example, the SAMCO uses Wii-styled lightbars which I already have plenty of from using my Wii remote on PC, so it seems awfully more convenient than the specific IR light pods that the G4IR uses. Is there an appreciable difference in accuracy between these two?
  • Sort of an appendix to the last question, but from what I can tell it looks like the G4IR will be getting some form of PS1/2 support as an emulatable Guncon 1. Since both of these projects are more or less running the same handful of Arduino-compatible boards at the core and use the same camera as one another, with just different sketches/software/calibration being the most apparent differences, is it possible the SAMCO will also see similar support? Admittedly, it's one of the reasons I got an EMS TopGun a couple years ago, to use with original hardware because PS2 specifically is a PITA for configuring with lightguns - not to mention the latest 1.7.x builds of PCSX2 removing plugin support, and subsequently killing the nuvee plugin this would rely on.
I know all of that might be a mouthful, but I'm admittedly only just now discovering lightgun mods so these are things I'm considering before diving in head-first for parts. AFAIC, SAMCO sounds cooler and more convenient for my setup, but I want to be sure is all!  ;D

Prow

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 11
  • Last login:Yesterday at 09:46:56 am
  • I'm here for Light Guns
    • github.com/Prow7/ir-light-gun
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #126 on: September 16, 2021, 10:01:10 pm »
Had a few asks, though:
  • How accurate is the SAMCO compared to other solutions? And for anyone who's used it, how is the performance any different with @Prow's enhanced fork? I feel like that may as well be the version I use whenever I get around to building this.
  • From what I can tell, the Gun4IR seems to be scarily similar to SAMCO, down to using the same board and camera, but I'm curious what the differences are between the two. For example, the SAMCO uses Wii-styled lightbars which I already have plenty of from using my Wii remote on PC, so it seems awfully more convenient than the specific IR light pods that the G4IR uses. Is there an appreciable difference in accuracy between these two?
  • Sort of an appendix to the last question, but from what I can tell it looks like the G4IR will be getting some form of PS1/2 support as an emulatable Guncon 1. Since both of these projects are more or less running the same handful of Arduino-compatible boards at the core and use the same camera as one another, with just different sketches/software/calibration being the most apparent differences, is it possible the SAMCO will also see similar support? Admittedly, it's one of the reasons I got an EMS TopGun a couple years ago, to use with original hardware because PS2 specifically is a PITA for configuring with lightguns - not to mention the latest 1.7.x builds of PCSX2 removing plugin support, and subsequently killing the nuvee plugin this would rely on.
I know all of that might be a mouthful, but I'm admittedly only just now discovering lightgun mods so these are things I'm considering before diving in head-first for parts. AFAIC, SAMCO sounds cooler and more convenient for my setup, but I want to be sure is all!  ;D

I can't compare the performance to other solutions but the SAMCO 4IR Beta code, which is what I used, has perfect accuracy for a single player directly in front of the screen. I'm currently using light sensor bars from an original EMS LCD TopGun. The only thing I have to do is block the middle IR LEDs on the one sensor bar that has 3 spots. This was one consideration for why I tried out the SAMCO build; it was very easy for me to make a little foam mount for one of the sensor bars to sit on top of my big screen TV.

I guess the main differences with Gun4IR are: different IR emitter layout, a configuration GUI, closed source project, and I think you must use a Pro Micro board (though check the project to confirm the supported boards).

Even though my code will build for the Pro Micro and the 32u4 ItsyBitsy boards, I recommend using an M0 or M4 SAMD board instead. Or, if you wait a bit, then hopefully soon I'll add support for the RP2040 ItsyBitsy and it will be another good option, at least for my code. I actually have it prototyped and working, just need to clean up the code a bit. :)

Interesting you mention PS1/2 support... I tried to find information on the original Xbox light guns, but couldn't find any information, so that was as close as I got to any console support.

Yes, it's a cool project and the custom SAMCO PCB is awesome! makes modding a GunCon super easy. 8)

ThatOneSeong

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 63
  • Last login:Yesterday at 11:48:38 pm
  • Just your average Seong.
    • Twitter
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #127 on: September 17, 2021, 12:53:38 pm »
I can't compare the performance to other solutions but the SAMCO 4IR Beta code, which is what I used, has perfect accuracy for a single player directly in front of the screen. I'm currently using light sensor bars from an original EMS LCD TopGun. The only thing I have to do is block the middle IR LEDs on the one sensor bar that has 3 spots. This was one consideration for why I tried out the SAMCO build; it was very easy for me to make a little foam mount for one of the sensor bars to sit on top of my big screen TV.

I guess the main differences with Gun4IR are: different IR emitter layout, a configuration GUI, closed source project, and I think you must use a Pro Micro board (though check the project to confirm the supported boards).

Even though my code will build for the Pro Micro and the 32u4 ItsyBitsy boards, I recommend using an M0 or M4 SAMD board instead. Or, if you wait a bit, then hopefully soon I'll add support for the RP2040 ItsyBitsy and it will be another good option, at least for my code. I actually have it prototyped and working, just need to clean up the code a bit. :)

Interesting you mention PS1/2 support... I tried to find information on the original Xbox light guns, but couldn't find any information, so that was as close as I got to any console support.

Yes, it's a cool project and the custom SAMCO PCB is awesome! makes modding a GunCon super easy. 8)
+1 for open source!
I was considering getting the M0 based on your recommendation on the repo, and for futureproofing anyways. But is there any user facing difference going for the RP2040 instead? I mean, I guess saving $2 on raw parts has its plus!I'm certainly patient, since I'd have to wait about a month on the camera alone anyways.

On the note of console support, apparently there's another SAMCO fork that allows it to work on actual PS2 hardware as a Gcon2 - or at least, that's the claim, as I obviously don't have a working setup to know for sure. It's only in the last two days I realized the post on this board. Now, it's obviously a stretch to suggest that these changes could be implemented retroactively in your project, but even just the possibility of having that compatibility is enough to make me genuinely more excited than I perhaps reasonably should be. :P
Anyways, glad to hear. I'll be waiting to see what updates comes to your code. It really has reinvigorated my interest in light gun games again. (^^

Prow

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 11
  • Last login:Yesterday at 09:46:56 am
  • I'm here for Light Guns
    • github.com/Prow7/ir-light-gun
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #128 on: September 18, 2021, 06:09:05 pm »
+1 for open source!
I was considering getting the M0 based on your recommendation on the repo, and for futureproofing anyways. But is there any user facing difference going for the RP2040 instead? I mean, I guess saving $2 on raw parts has its plus!I'm certainly patient, since I'd have to wait about a month on the camera alone anyways.
It looks like it should be a drop in alternate to the M0 or M4, at least for the SAMCO project from what I can see. I think even all of the Arduino pin numbers for the buttons match up for the GunCon 2 SAMCO PCB, so the button configuration in the sketch doesn't even need to change.

Quote
On the note of console support, apparently there's another SAMCO fork that allows it to work on actual PS2 hardware as a Gcon2 - or at least, that's the claim, as I obviously don't have a working setup to know for sure. It's only in the last two days I realized the post on this board. Now, it's obviously a stretch to suggest that these changes could be implemented retroactively in your project, but even just the possibility of having that compatibility is enough to make me genuinely more excited than I perhaps reasonably should be. :P
Anyways, glad to hear. I'll be waiting to see what updates comes to your code. It really has reinvigorated my interest in light gun games again. (^^
I don't have a PS2 so I can't test out that code. It would be cool to have that working though.

ThatOneSeong

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 63
  • Last login:Yesterday at 11:48:38 pm
  • Just your average Seong.
    • Twitter
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #129 on: September 20, 2021, 09:13:22 am »
It looks like it should be a drop in alternate to the M0 or M4, at least for the SAMCO project from what I can see. I think even all of the Arduino pin numbers for the buttons match up for the GunCon 2 SAMCO PCB, so the button configuration in the sketch doesn't even need to change.
That looks to be the case.And since the M0 is out of stock, I guess I'm going RP2040.Just ordered all the parts for myself. It'll be a bit belated, but I think it'll be a good enough gift for myself. :p

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #130 on: September 22, 2021, 01:47:24 am »
Hi ThatOneSong, yeah from what I can tell the ItsyBitsy RP2040 should work fine with the M0 sketch. But if you have any problems just let us know either here or on my facebook. https://www.facebook.com/groups/2456595207897603 :)


ThatOneSeong

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 63
  • Last login:Yesterday at 11:48:38 pm
  • Just your average Seong.
    • Twitter
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #131 on: September 22, 2021, 10:49:25 am »
Hi ThatOneSong, yeah from what I can tell the ItsyBitsy RP2040 should work fine with the M0 sketch. But if you have any problems just let us know either here or on my facebook. https://www.facebook.com/groups/2456595207897603 :)
I'm looking forward to it! By which I mean, a while for the board and other parts to arrive. Unfortunately I wasn't quick enough on the trigger for the camera so it's on backorder for the moment, but everything--aside from the ItsyBitsy RP and a 3m cable--is being imported anyways. (^^;

Prow

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 11
  • Last login:Yesterday at 09:46:56 am
  • I'm here for Light Guns
    • github.com/Prow7/ir-light-gun
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #132 on: September 22, 2021, 12:34:20 pm »
Hi ThatOneSong, yeah from what I can tell the ItsyBitsy RP2040 should work fine with the M0 sketch. But if you have any problems just let us know either here or on my facebook. https://www.facebook.com/groups/2456595207897603 :)
One thing to note is that the ItsyBitsy RP2040 currently will not work with your sketch. The RP2040 does not support the Arduino USB stack and the AbsMouse library only supports the Arduino USB stack.

My modified AbsMouse5 library is working with the Adafruit TinyUSB stack now, which is an option for the RP2040. This update is not yet on my GitHub project, but hopefully soon I'll get back to working on it.

ThatOneSeong

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 63
  • Last login:Yesterday at 11:48:38 pm
  • Just your average Seong.
    • Twitter
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #133 on: September 30, 2021, 10:52:58 am »
Just came in to say I've just received both IB-RP2040 and Samco boards - extra props to samco of course for the quick turnaround. The GCon2 itself is still on its way, but unfortunately the camera has been sitting on Backordered for a bit now. Not sure how long it takes DFrobot to fulfill orders; I didn't anticipate them being in such high demand.
Regardless, I'll be waiting eagerly on the 2040 sketch update.  :applaud:

Prow

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 11
  • Last login:Yesterday at 09:46:56 am
  • I'm here for Light Guns
    • github.com/Prow7/ir-light-gun
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #134 on: October 01, 2021, 10:48:36 pm »
The update for the ItsyBitsy RP2040 is now available.

One thing to note is the button pin values in the sketch must be modified if you use the ItsyBitsy RP2040. The sketch uses the Arduino pin numbering as printed on the top of the PCB but these values don't work for the RP2040. The button pin values must be the physical GPIO pin numbers printed on the bottom of the PCB (or see the Adafruit pinouts page). More details on this in the readme. It was a bit odd to me since the A0 through A3 pins are defined, but the digital pins aren't translated... for example D7 is defined as 7, which doesn't translate Arduino to GPIO. ¯\_(ツ)_/¯


samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #135 on: October 05, 2021, 08:22:39 pm »
Nice one Prow! Thanks for the heads up on the AbsMouse Library too. I don't have too much time to tinker at the moment so I'll be keeping an eye on this thread to see how this goes and what you guys think of the RP2040.

ThatOneSeong

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 63
  • Last login:Yesterday at 11:48:38 pm
  • Just your average Seong.
    • Twitter
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #136 on: October 06, 2021, 07:57:30 pm »
So I will say the process of getting here was a bit of an experience for me...
First off, without even having gun in hand, following the procedures in advance setting the board up had me for a loop.Firstly, even getting an RP2040 recognized in Arduino software--which Adafruit's store page and documentation contradict one-another atm (one says there is no support, another generic Raspberry Pico page was updated saying there is...)--was difficult since it's a third-party repository that needed a bit of searching to find. Would be nice to add this in the SamcoEnhanced readme for 2040-ers.Sidenote, this might just be my PC, but the board wasn't being assigned a serial driver like it's supposed to, but was stubbornly hanging as an unknown device with no known drivers. I had to force the 'RP2 USB' device to use a Microsoft-brand USB Serial Device. But at least afterwards, I can assign the port number and it was able to be flashed just fine.
One thing that was unclear as a first-timer was the note in the Enhanced repo;
Quote
If you are using an ItsyBitsy M0 or M4 then I recommend you set the Optimize option to -O3 (or faster). If you are using an ItsyBitsy RP2040 then I recommend the -O3 Optimize option.
I was looking and couldn't find any such Optimize flag options; neither in the Preferences, or the Sketch/Tools dropdowns that Ada's documentation suggested should be there. Nada.And results when searching for "Arduino optimization flags" kept bringing up coding habits, but not the GCC flags. There was only one I could find after going through multiple pages that pointed to C:\Program Files (x86)\Arduino\hardware\arduino\avr\platform.txt where I could change the references of -Os to -O3. If there is something I'm overlooking here, feel free to say, but maybe a note should be appended on what exactly this step means on the latest Arduino IDE.
Anyways, from there, code runs, that's all I could get at the time. Fast forward to today and my GCon 2 arrives. Time to get to work.Disassembly and all that wasn't hard at all, thanks to Samco's own video documentation on the process. This was my first substantial soldering work in quite some time, so I was proud to see good joints coming out of it.My main difficulty came when I was adding in a microswitch mod where I had to rip out the original trigger tact switch (what a frick that was), and plant in a microswitch alongside a replacement arm attached to the trigger. While that worked out, it made cable routing feel kind of precarious - of which I also had a bit of trouble, since I tried attaching my microUSB to the board after attaching the B button board, which wouldn't work. I had to take out the button standoff and put the cable in before reattaching, but it felt quite tight. Thankfully, it all ended up coming together in the end.
Prow is all too right about the GPIO mapping. But I figured it out with just a bit of cross-referencing Samco's documents;
Code: [Select]
Trigger = 6
D-Up = 9
D-Left = 8
D-Down = 7
D-Right = 10
C = 11
A/B/Start/Select/Pedal stays the same.
While I'm unfortunately still not able to use the gun due to the camera still being backordered, I can at least confirm all the inputs work (after changing the sketch mappings) as well as the calibration toggle. It will unfortunately be another lengthy wait I imagine before this is really finished, but the process so far has been fun and leaving me with great anticipation for what it's like when it's really working.
A lot of rambling for a lot of nothing seems to be my only contributions here, but I'm kind of okay with that. (^^;

ThatOneSeong

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 63
  • Last login:Yesterday at 11:48:38 pm
  • Just your average Seong.
    • Twitter
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #137 on: October 11, 2021, 07:46:50 pm »
Self-bumping update: I got the camera, and aside from the TOP label being off by 90 degrees clockwise, it all seems to be working. I'm glad I got one more sensor bar than I needed because the sole one I've had on my monitor for a few years for my Wiimote has such a narrow FOV compared to the new ones I'd just ordered, it's crazy.
I did manage to play through Time Crisis on MAME without any issue, it tracks surprisingly really well and no latency--especially when coming from a wireless EMS.
But after I decided to play T2 Arcade, a few minutes in, the trigger started acting a bit funny and some of the depressed shots were only firing off for a frame or something. It didn't seem to be consistent, but weird how it crops up so late into it.
From what I can tell, I think on some inputs, it's double-clicking instead of firing once and holding like I want it to? Because it's not just the trigger - the start button also on rare occasions can spurt out 1111 which was odd (esp. since it's one of the buttons directly embedded to the Samco2 board).
I was going to say it worked better some time later, but when playing a Naomi shooter through the Flycast core on RetroArch, again halfway through, all my on-screen shots just... stop registering? And when I alt-tabbed, this very messagebox I'm typing this in was being spammed with 1111's.
It's stuff like that which makes it hard for me to believe it's just the trigger microswitch that's bad... it's literally brand new and I even triple-checked my solder points; no joints touching one-another or anything. After writing this part I played Point Blank with lr-Duckstation with no issues, just like with Time Crisis (though I did note two small instances of double-clicking). Maybe it's just brandist against anything non-Namco.

@Prow, any idea what's up here?

EDIT:L Update to the update. Of course, the next morning I try to confirm the trigger issue and it's working perfectly again. But the D-pad (and kinda start button) is still sticky sometimes.

But I've noticed on two separate instances that after some time (pretty much *only* happens after putting the gun down for a bit then up again), the calibrated aim is offset a quarter-screen to the right, despite not having moved at all since. But it's fixed with a re-calibration, so... I don't have a clue really.
« Last Edit: October 12, 2021, 11:08:33 am by ThatOneSeong »

Prow

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 11
  • Last login:Yesterday at 09:46:56 am
  • I'm here for Light Guns
    • github.com/Prow7/ir-light-gun
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #138 on: October 13, 2021, 01:08:52 am »

From what I can tell, I think on some inputs, it's double-clicking instead of firing once and holding like I want it to? Because it's not just the trigger - the start button also on rare occasions can spurt out 1111 which was odd (esp. since it's one of the buttons directly embedded to the Samco2 board).
I was going to say it worked better some time later, but when playing a Naomi shooter through the Flycast core on RetroArch, again halfway through, all my on-screen shots just... stop registering? And when I alt-tabbed, this very messagebox I'm typing this in was being spammed with 1111's.
Adjusting the debounce time will hopefully fix this. I'm not sure why I set the debounce times lower than they need to be. I'll make a note to fix the sketch. With that said, I don't have any issue with my gun and the buttons.

Quote
But I've noticed on two separate instances that after some time (pretty much *only* happens after putting the gun down for a bit then up again), the calibrated aim is offset a quarter-screen to the right, despite not having moved at all since. But it's fixed with a re-calibration, so... I don't have a clue really.
Interesting you report this as I had this happen once recently. In my case, I reconnected the USB cable and it was fine since I have the calibration stored in NVRAM. Just as you say, I recall I set the gun down for a bit and then when I picked it up the aim was way off. If you can reproduce this it would be interesting to know if the calibration values somehow change. You can view them in the serial monitor (or any serial terminal program). I was unable to reproduce it, but only tried a few times.

Quote
I was looking and couldn't find any such Optimize flag options; neither in the Preferences, or the Sketch/Tools dropdowns
I jumped the gun on this one... I submitted a Pull Request to the Arduino Pico project and expected an update to be released before anyone would actually use an RP2040 build. It actually may not matter all that much, but might as well optimize for speed. I'll update the wording to describe it as an optional setting if it's available.

ThatOneSeong

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 63
  • Last login:Yesterday at 11:48:38 pm
  • Just your average Seong.
    • Twitter
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #139 on: October 17, 2021, 10:33:35 pm »
Heeey, sorry for the wait. Been pulled away for some time on some PC upgrades and switching to Linux. Fun.
Interesting you report this as I had this happen once recently. In my case, I reconnected the USB cable and it was fine since I have the calibration stored in NVRAM. Just as you say, I recall I set the gun down for a bit and then when I picked it up the aim was way off. If you can reproduce this it would be interesting to know if the calibration values somehow change. You can view them in the serial monitor (or any serial terminal program). I was unable to reproduce it, but only tried a few times.
Seems like we've both only had this happen once without any way to reproduce. But this hasn't happened often. And I appreciate the honesty - easily forgiven, though no less confusing for a first-timer. I think it's safe to say the debounce--or lack thereof--only affects my membrane buttons, but definitely not an issue with the trigger (the unresponsiveness might've just needed some time to get worn in. shrug).
As of now, I'm just trying to work out how to get this working in X11. Not the most straightforward thing to say the least. :laugh:

DeKay

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 1
  • Last login:January 28, 2024, 01:31:20 pm
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #140 on: October 25, 2021, 07:03:59 pm »
Hey Prow.  You and Samco are doing great work here!  I sent you a few minor fixes for things I tripped over getting my ItsyBitsy M4 set up this weekend in a github pull request.  I really have to learn to use git properly one of these days   :)

woordmand

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 21
  • Last login:January 27, 2022, 01:34:09 pm
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #141 on: January 07, 2022, 12:03:20 am »
I made an enhanced version of the SAMCO project. The enhancements are:
  • Increased precision for maths and mouse pointer position
  • Glitch-free DFRobot positioning (DFRobotIRPositionEx library)
  • IR camera sensitivity adjustment (DFRobotIRPositionEx library)
  • Optional averaging modes can be enabled to slightly reduce mouse position jitter
  • Enhanced button debouncing and handling (LightgunButtons library)
  • Modified AbsMouse to be a 5 button device (AbsMouse5 library)
  • Multiple calibration profiles
  • Save settings and calibration profiles to flash memory (SAMD) or EEPROM (ATmega32U4)
  • Built in Processing mode for use with the SAMCO Processing sketch

Much of the code was re-worked but the positioning math calculation is all from SAMCO. It is fantastic how well this works!

One big change is with the button handling code that allows button combinations. For example, you can assign a button combination to enter pause mode that you will never press while playing a game so the reload button can be assigned a mouse button or key press.

The other big enhancement is the calibration profiles. I found myself sometimes wanting to play on my big screen TV and other times on my monitor. Combine that with 4:3 aspect ratio games requiring different calibration data, adding multiple profiles is an obvious solution. While the calibration procedure is simple, it's even faster to just press a button to select a profile.

Support for the ATmega32U4 boards was a bit of a last minute addition and not as well tested, but it should work (though I haven't tested saving to EEPROM).

The buttons in the sketch are configured for a SAMCO 2.0 GunCon 2 build. If your gun has different button pin assignments then you will have to modify the sketch.

You can get the source code from: https://github.com/Prow7/ir-light-gun
See the readme files on GitHub for more details.

Big thanks to Samco for this project. Your custom PCB made it super easy to mod a GunCon 2! Also thanks to Gustavo for his Apexel lens adapter models. A fantastic solution to the less than ideal narrow FOV that the camera has.
I used your improved version of sanco firmware on 32U4, it is really good.  But compared to gun4ir, it lacks support for electromagnets.  Calibration is not very friendly either.  Hope to see the updated version of the firmware.

sparehead1

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:March 05, 2023, 01:15:33 am
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #142 on: January 07, 2022, 05:49:23 am »
Hi there! I've ordered some Samco boards, guncon 2's, cameras, and itsy-bitsy M4's. I want to use them on a projector screen so I was wondering if there are guides for the distance from the screen in relation to screen size? Can I use fish eye or wide-angle lenses? Should I still use Wii sensor bars or can I use 4 IR LED's spaced out a little more? Thanks in advance! I'm looking forward to building them!

Prow

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 11
  • Last login:Yesterday at 09:46:56 am
  • I'm here for Light Guns
    • github.com/Prow7/ir-light-gun
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #143 on: January 07, 2022, 12:24:50 pm »
Hi there! I've ordered some Samco boards, guncon 2's, cameras, and itsy-bitsy M4's. I want to use them on a projector screen so I was wondering if there are guides for the distance from the screen in relation to screen size? Can I use fish eye or wide-angle lenses? Should I still use Wii sensor bars or can I use 4 IR LED's spaced out a little more? Thanks in advance! I'm looking forward to building them!
From my experience you will want to use at least a wide angle lens.

If you already have 2 Wii sensor bars then might as well just try it out with them first.

For a bit of reference, I use sensor bars from an original EMS LCD TopGun which have the IR emitters approximately 33cm apart. I have a super wide angle lens on my gun (the FOV is less than a fish eye lens) and I can be positioned around 2M away from my 65" TV.

sparehead1

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:March 05, 2023, 01:15:33 am
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #144 on: January 07, 2022, 10:46:52 pm »
Thanks Prow :)

I dont have sensor bars yet so I think I'll make some IR LED arrays. Any recommendations for super wide or fish eye lens's? I want to use it on my 110" screen.

Prow

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 11
  • Last login:Yesterday at 09:46:56 am
  • I'm here for Light Guns
    • github.com/Prow7/ir-light-gun
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #145 on: January 08, 2022, 03:49:09 pm »
I dont have sensor bars yet so I think I'll make some IR LED arrays. Any recommendations for super wide or fish eye lens's? I want to use it on my 110" screen.
Good idea to make your own IR emitters. I can only guess maybe Wii sensor bars may not be spaced out enough for a screen that large.

For the lenses, I bought an Apexel lens kit. However, I have noticed many people in the Gun4IR Discord buy a cheap 3 in 1 mobile phone lens kit which includes a wide angle and fish eye lens. I don't know if some accuracy aiming at the corners will be lost when using a fish eye lens due to the distortion, I haven't tried it. :dunno I saw that mentioned which is why I initially used the wide angle lens but then swapped in the super wide angle lens.

rbarr110

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 298
  • Last login:September 25, 2023, 04:02:41 pm
  • I already built my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #146 on: January 09, 2022, 03:00:14 pm »
I am so glad I found this thread.  I wanted light guns soooo bad 10-15 years ago when I was more active here.  My current machine I built is too big for my wife, thanks CRT monitors.  So I have been toying with a new cabinet design off and on for years and finally got to a point that I think I can make what I want.

Had the GunCon 2's for a while and the SAMCO solution looks soo easy that I had to do it.  Everything is ordered, only thing that may hold this back is the damn backordered DF robot cameras. 

sparehead1

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:March 05, 2023, 01:15:33 am
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #147 on: January 10, 2022, 05:14:34 am »
For the super wide lens this the one that's recommended?

Prow

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 11
  • Last login:Yesterday at 09:46:56 am
  • I'm here for Light Guns
    • github.com/Prow7/ir-light-gun
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #148 on: January 10, 2022, 12:16:40 pm »
For the super wide lens this the one that's recommended?
I have the APL-DG7 lens kit (7 in 1). So that kit does look similar and gives you the 3 useful lenses to try out.

ThatOneSeong

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 63
  • Last login:Yesterday at 11:48:38 pm
  • Just your average Seong.
    • Twitter
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #149 on: January 18, 2022, 01:37:10 pm »
However, I have noticed many people in the Gun4IR Discord buy a cheap 3 in 1 mobile phone lens kit which includes a wide angle and fish eye lens. I don't know if some accuracy aiming at the corners will be lost when using a fish eye lens due to the distortion, I haven't tried it. :dunno
I can speak to being one of those "many people." It's okay I suppose. The fisheye causes too much distortion for the dual light-strip array, presumably whacking out the rectangular field that the sketch expects. Using the wide angle combination seems to work better, about as fine as vanilla, though I had to bump up the sensitivity by one level to make it work consistently (dunno how much of that is just having more sunlight than usual).
If only I'd known this earlier; the super wide lens seems the best option for Samco in general. But that'll have to wait until after I've moved house. Another two months long wait for shipping from China.  :badmood:

sparehead1

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:March 05, 2023, 01:15:33 am
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #150 on: January 18, 2022, 07:04:59 pm »
I went with the super wide which is now on a slow boat. I thought I'd snagged the last 2 cameras from element14 but now my order says they are on back order and not expected to ship until June  :(

sparehead1

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:March 05, 2023, 01:15:33 am
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #151 on: May 14, 2022, 08:13:08 pm »
My camera's turned up :D

now I need to find a way to attach the wide-angle lens's :/

scratcher53

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 4
  • Last login:February 07, 2024, 07:47:17 pm
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #152 on: May 19, 2022, 05:02:39 pm »
Hi All,
New to light guns but have a few questions.
i have built two Samco guncon2 guns and using the 4 ir sketch, may use prow enhanced sketch, is there a way to re asign some keys. EG move the calibration key to the down key on the d pad and asign ESC to the up key. Also move the reload key from the left side to the bottom (currently the calibration key) ?
Thanks,


fgh

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:March 26, 2024, 04:27:20 am
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #153 on: October 05, 2022, 02:19:40 am »
Hey guys,

Finally got myself some Samco boards for some light gun action..


Samco: Absolutely awesome work! This is so convenient with the PCB all laid out! I've uploaded the 4IR_beta sketch, and it tracks well. (GCon2, 32u4).
Also, I saw your cool mini cabinet with that sweet recalbox setup. Any chance you will ever share it (without roms)? Is it a pi3 or 4?

Anyway - I'm loving it so far. Will make a dedicated cabinet similar to my main cab (link), but with just one monitor.
Thanks a lot for making this! :)


Prow: That looks like some nice updates! I just had a go with your sketch as well. My setup works well so far on Samco's 4IR_beta on a guncon2 with a 32u4 5V.
With your sketch, however, I have trouble calibrating. Both X and Y seems to be offset by more than half my 27" screen, and when calibrating, the A and B buttons do not seem to have any effect. (This part also works well with Samco's sketch.)
Also tried the relevant dpad buttons to move the X/Y centering (pushed momentarily and held them down lots of times), but nothing happened. (all buttons work in notepad).
In other words - As soon as I start calibrating by pressing the trigger while aiming at the center cursor, the cursor jumps quite far upwards for the vertical alignment, and I cannot get it to center or track any closer. And a similar jump to the left edge when starting horizontal calibration.
So I get smooth tracking from both sensor bars it seems, but offset by a huuge margin. (30-40cm horizontal and 15-20cm vertical)
Any ideas?

(I don't know how to set compiler options, but as far as I could see from the docs, I could leave all at default for 32u4 and guncon2.)


Cheers,
Frode
« Last Edit: October 05, 2022, 02:29:22 am by fgh »

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #154 on: October 11, 2022, 05:46:34 pm »
Thanks Frode! Yeah, my mini cabinet runs on a Pi4 8Gb. Was planning on cleaning up the theme a bit (it's the first one I've ever made so it's a bit of mess) and adding a few more guns i.e. PS2 etc but got a bit busy so went on the back burner. Hopefully one day I'll get some time to fix it all up and release it.

Cheers Sam(co)

DemmyTree

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:December 02, 2022, 10:50:56 am
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #155 on: November 29, 2022, 03:28:53 pm »
Sorry to bother you, im having issues with the setup of the lightgun, i've bound everything to the PCB and have been trying to upload the code but it is coming up with failures no matter what im attempting.

It seems the problem that comes up is mainly to do with the HID and USB Endpoint, im not sure what that means and need assistance if anyone is able to explain this.

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #156 on: December 01, 2022, 07:54:47 pm »
Sorry to bother you, im having issues with the setup of the lightgun, i've bound everything to the PCB and have been trying to upload the code but it is coming up with failures no matter what im attempting.

It seems the problem that comes up is mainly to do with the HID and USB Endpoint, im not sure what that means and need assistance if anyone is able to explain this.


Hi Mate, any chance you can chuck up a screenshot of the IDE (including errors). Might be able to give ya hand.

DemmyTree

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:December 02, 2022, 10:50:56 am
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #157 on: December 02, 2022, 10:49:23 am »
Sorry to bother you, im having issues with the setup of the lightgun, i've bound everything to the PCB and have been trying to upload the code but it is coming up with failures no matter what im attempting.

It seems the problem that comes up is mainly to do with the HID and USB Endpoint, im not sure what that means and need assistance if anyone is able to explain this.


Hi Mate, any chance you can chuck up a screenshot of the IDE (including errors). Might be able to give ya hand.
I've never touched Arduino before and just used the stock sketch you created for it. Im using the ItsyBitsy M0 Express but have also attempted it on a M4 Express as well.

The version is 1.8.15 on Samco_1.1_4IR_BETA.ino (i have tried the 2IR version and also had the same failure occurrence) The board is not soldered onto the PCB however it is held in by headers with an additional header to keep it in place

On the serial monitor it picks up the camera partially keeps repeating with no movement of the cursor occuring when shifting the gun around.
15:47:58.811 -> CALIBRATION:     Cam Center x/y: 512, 450     Offsets x/y: 1.47, 0.82
15:47:58.861 -> Device not available!


In file included from C:\Users\DemmyTree\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.11\cores\arduino/Arduino.h:157,
                 from C:\Users\DemmyTree\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.11\cores\arduino/USB/SAMD21_USBDevice.h:22,
                 from C:\Users\DemmyTree\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.11\cores\arduino/USB/USBAPI.h:37,
                 from C:\Users\DemmyTree\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.11\cores\arduino/USB/PluggableUSB.h:23,
                 from C:\Users\DemmyTree\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.11\libraries\HID\HID.cpp:19:
C:\Users\DemmyTree\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.11\libraries\HID\HID.cpp: In member function 'virtual int HID_::getInterface(uint8_t*)':
C:\Users\DemmyTree\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.11\cores\arduino/USB/USBCore.h:37:56: warning: narrowing conversion of '(int)(((unsigned char)((int)((HID_*)this)->HID_::<anonymous>.PluggableUSBModule::pluggedEndpoint)) | 128)' from 'int' to 'uint8_t' {aka 'unsigned char'} [-Wnarrowing]
   37 | #define USB_ENDPOINT_IN(addr)                  ((addr) | 0x80)
      |                                                ~~~~~~~~^~~~~~~
C:\Users\DemmyTree\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.11\cores\arduino/USB/USBCore.h:276:10: note: in definition of macro 'D_ENDPOINT'
  276 |  { 7, 5, _addr,_attr,_packetSize, _interval }
      |          ^~~~~
C:\Users\DemmyTree\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.11\libraries\HID\HID.cpp:36:14: note: in expansion of macro 'USB_ENDPOINT_IN'
   36 |   D_ENDPOINT(USB_ENDPOINT_IN(pluggedEndpoint), USB_ENDPOINT_TYPE_INTERRUPT, 0x40, 0x01)
      |              ^~~~~~~~~~~~~~~
Sketch uses 48236 bytes (18%) of program storage space. Maximum is 262144 bytes.
Device       : ATSAMD21x18
Version      : v1.1 [Arduino:XYZ] Jun 23 2019 17:45:14
Address      : 0x0
Pages        : 4096
Page Size    : 64 bytes
Total Size   : 256KB
Planes       : 1
Lock Regions : 16
Locked       : none
Security     : false
BOD          : true
BOR          : true
Write 48556 bytes to flash (759 pages)
[==============================] 100% (759/759 pages)
Done in 9.417 seconds
Verify 48556 bytes of flash
[==============================] 100% (759/759 pages)
Verify successful
Done in 3.808 seconds

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #158 on: December 05, 2022, 01:22:12 am »
Hi @DemmyTree, it looks like a connection problem. "Device not available!" basically mean the ItsyBitsy cannot connect to the camera so you could double check you've got all the wires round the right way and try again. But I think it's probably more likely you just not getting a good connection because nothing is soldered in.

scratcher53

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 4
  • Last login:February 07, 2024, 07:47:17 pm
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #159 on: December 11, 2022, 07:45:33 pm »
Hi Sam,

I have built two of your guns and use them with demulshooter and various emulators in bigbox / launchbox. The problem i have is people keep hitting the calibration button by mistake. The question is can i change the calibration button to one of the d pad buttons and then have the original calibration button as the reload button. I have looked at the code but it all went over my head.
Thanks for the help

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #160 on: December 12, 2022, 06:21:30 pm »
@scratcher no problem mate. The easiest way is to just reallocate those pins. So find the bit in the code that looks like this and swap the values around like this...

int _tiggerPin = 7;               // Label Pin to buttons
int _upPin = 11;               
int _downPin = 13;             
int _leftPin = 10;             
int _rightPin = 12;               
int _APin = A1;               
int _BPin = A0;             
int _startPin = A2;
int _selectPin = A3;               
int _reloadPin = 9;
int _pedalPin = 5;   

That will swap those function around. i.e down is now calibration and the old calibration button is now down.

ThatOneSeong

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 63
  • Last login:Yesterday at 11:48:38 pm
  • Just your average Seong.
    • Twitter
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #161 on: April 02, 2023, 02:21:48 pm »
Long time no see, everyone!
Weird to think this has been going for two/three years, but I'm still maining Prow's fork with no issues* on Linux. FWIW, I've made a small modification to allow setting the gun to pause mode with a key combination so I can use C as Mouse Thumb 1/Mouse4, what with the recent merging of PCSX2 GunCon2 support for all platforms.
In case anyone's interested in following along, to change Pause mode to a combination of C + Select, change line 178/179 to:
Code: [Select]
// button combo to enter pause mode
constexpr uint32_t EnterPauseModeBtnMask = BtnMask_Reload | BtnMask_Select;
I'd make a pull request but I wasn't sure how many people would want to change this behavior.

*Actually there is a problem, but not from the gun or the software itself. I'm starting to realize that the cheap sensor bars I've been buying have a bad habit of dimming over time. Because of this, I've been tempted to buy RPEG's high-power black LEDs used for GUN4IR, and just arranging them in the same orientation as a top/bottom Wii lightbar, but maybe this is a bit extreme? I've tried looking into other Wii USB lightbars, but they all look exactly the same; having three leds on either side instead of five, and a tendency to dim over a period of time. I've also looked into the wireless options like the Power A Ultrabar, but not only would I be wasting batteries but getting a pair would be about as expensive as buying the kit from RPEG. And buying bulk lots of the cheap bars seems even more wasteful (not to mention a hassle of switching them out every so often). I could perhaps take some legit OEM Wii sensor bars and mangle them to work off USB/another non-Wii centric power source, but that seems messy. Are some knockoff Wii sensor bar brands better than others, maybe?
I'm just not sure. Has anyone else ran into this issue? Mayhaps some of the Lichtknarre 2LED users can chime in here? I'm just trying to figure the best way of doing this, as I do plan on making potential videos about PC Light Guns and will probably highlight Samco in the process (mayhaps alongside Gun4IR? Not sure), so I'd like to know what exactly to recommend/what the common consensus is for my own research.

famichiki

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 1
  • Last login:June 09, 2023, 10:27:13 pm
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #162 on: June 06, 2023, 09:55:48 pm »
I've bought Sam's PCB and am trying to figure out which board to go with out of the ItsyBitsy 32u4, M0 or M4.

Disregarding the ability to save the calibration and putting cost aside, why not choose the M0 or M4? The price isn't much more and they appear substantially faster on paper. Is there anything to be aware of with the ARM processors?

Do both the 3v and 5v 32u4 comfortably run with additional processor headroom for custom tweaks to the code, such as adding recoil solenoids etc? Or are they already maxxed out handling the tracking? I have a few ideas I want to incorporate.

Also, is there any more overhead for running the 4IR code vs the 2IR?

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #163 on: June 12, 2023, 08:20:53 pm »
Hi Mate, I've found the 32u4 3V can seem to run a tiny bit slightly slower than than the 5V but no noticeable difference to M0 or M4 (I assume because it can only run as fast as the camera can update the points but haven't done any testing on this). There is still a bit of flash space (about 7kb) on the 32u4 using the 4IR sketch (which is heaver) to to add to sketch if you wanted to. I prefer using the 324 5V because I like how it saves to eeprom. Like I said haven't done any actual tests so if anyone has I be interested in the results?

dabone

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 898
  • Last login:October 31, 2023, 12:03:37 pm
  • Time to work...
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #164 on: August 25, 2023, 03:47:45 pm »
I ordered and built to samco gc2 boards using the ItsyBitsy 32u4-5V, and I've tried both firmwares, but here's a easy question.

Where should the LEDs be mounted?

The gun IR wants them placed on the middle of the top/bottom and sides.

Where should the LEDS be placed for the samco firmwares? I'm running the 4 led config, using 3 SFH 4547 LEDs per led position.

Thanks.

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #165 on: August 27, 2023, 06:23:08 pm »
Hi dabone, it's made to work with with 2 wii sensor bars like in this picture but you can also use your own leds by placing then in the same spots. Marked up in red on the picture.

Cheers Sam(co)


ThatOneSeong

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 63
  • Last login:Yesterday at 11:48:38 pm
  • Just your average Seong.
    • Twitter
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #166 on: August 31, 2023, 02:59:24 am »
I ordered and built to samco gc2 boards using the ItsyBitsy 32u4-5V, and I've tried both firmwares, but here's a easy question.

Where should the LEDs be mounted?

The gun IR wants them placed on the middle of the top/bottom and sides.

Where should the LEDS be placed for the samco firmwares? I'm running the 4 led config, using 3 SFH 4547 LEDs per led position.

Thanks.
How convenient, as I had just ordered a full set of those LEDs [and other parts] to make a custom light set for SAMCO. I was  done dealing with the shoddy knockoff IR bars, and now that I'd paid the cost of parts I think RPEG's premade sets are way overpriced imo. It's not exactly going to be the prettiest thing, but should hopefully work better and last longer.
But, yeah, basically the idea is just place pairs of LEDs roundabout the same distance as the space between the two arrays of LEDs in the Wii lightbars (about ~3 inches apart) at the top and bottom to form a rectangle around the center of the display. Probably doesn't have to be that exact distance depending on the display size, i.e. big TV or small monitor, etc, but enough to form the basic shape for tracking.

retroman2022

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:September 01, 2023, 02:25:50 pm
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #167 on: September 01, 2023, 01:55:06 pm »
Hi Samco!!

Amazing your job!

Questions: do you will contonue with this project? Ex:add recoil, rumble, etc?

Thanks

retroman2022

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:September 01, 2023, 02:25:50 pm
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #168 on: September 01, 2023, 02:11:24 pm »
Had a few asks, though:
  • How accurate is the SAMCO compared to other solutions? And for anyone who's used it, how is the performance any different with @Prow's enhanced fork? I feel like that may as well be the version I use whenever I get around to building this.
  • From what I can tell, the Gun4IR seems to be scarily similar to SAMCO, down to using the same board and camera, but I'm curious what the differences are between the two. For example, the SAMCO uses Wii-styled lightbars which I already have plenty of from using my Wii remote on PC, so it seems awfully more convenient than the specific IR light pods that the G4IR uses. Is there an appreciable difference in accuracy between these two?
  • Sort of an appendix to the last question, but from what I can tell it looks like the G4IR will be getting some form of PS1/2 support as an emulatable Guncon 1. Since both of these projects are more or less running the same handful of Arduino-compatible boards at the core and use the same camera as one another, with just different sketches/software/calibration being the most apparent differences, is it possible the SAMCO will also see similar support? Admittedly, it's one of the reasons I got an EMS TopGun a couple years ago, to use with original hardware because PS2 specifically is a PITA for configuring with lightguns - not to mention the latest 1.7.x builds of PCSX2 removing plugin support, and subsequently killing the nuvee plugin this would rely on.
I know all of that might be a mouthful, but I'm admittedly only just now discovering lightgun mods so these are things I'm considering before diving in head-first for parts. AFAIC, SAMCO sounds cooler and more convenient for my setup, but I want to be sure is all!  ;D

I can't compare the performance to other solutions but the SAMCO 4IR Beta code, which is what I used, has perfect accuracy for a single player directly in front of the screen. I'm currently using light sensor bars from an original EMS LCD TopGun. The only thing I have to do is block the middle IR LEDs on the one sensor bar that has 3 spots. This was one consideration for why I tried out the SAMCO build; it was very easy for me to make a little foam mount for one of the sensor bars to sit on top of my big screen TV.

I guess the main differences with Gun4IR are: different IR emitter layout, a configuration GUI, closed source project, and I think you must use a Pro Micro board (though check the project to confirm the supported boards).

Even though my code will build for the Pro Micro and the 32u4 ItsyBitsy boards, I recommend using an M0 or M4 SAMD board instead. Or, if you wait a bit, then hopefully soon I'll add support for the RP2040 ItsyBitsy and it will be another good option, at least for my code. I actually have it prototyped and working, just need to clean up the code a bit. :)

Interesting you mention PS1/2 support... I tried to find information on the original Xbox light guns, but couldn't find any information, so that was as close as I got to any console support.

Yes, it's a cool project and the custom SAMCO PCB is awesome! makes modding a GunCon super easy. 8)

Hi,

I can use two guns at Time?

Thanks.

ThatOneSeong

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 63
  • Last login:Yesterday at 11:48:38 pm
  • Just your average Seong.
    • Twitter
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #169 on: September 05, 2023, 11:43:23 am »
Hi,
I can use two guns at Time?

Thanks.
Should be possible, if it's anything like the Gun4IR.I don't know how many others have more than one SAMCO modded gun controller (except maybe sam himself lol), but it should be fine? Only thing that might be a problem is having two devices with the same vendor/product ID pair.

Coincidentally, I am planning on a second gun mod, so guess I'll know by then?

ThatOneSeong

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 63
  • Last login:Yesterday at 11:48:38 pm
  • Just your average Seong.
    • Twitter
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #170 on: September 05, 2023, 12:07:15 pm »
Do both the 3v and 5v 32u4 comfortably run with additional processor headroom for custom tweaks to the code, such as adding recoil solenoids etc? Or are they already maxxed out handling the tracking? I have a few ideas I want to incorporate.
Late to this I know, but if you're still working on this, I would be highly interested in the results. I plan to have a solenoid option on my second gun, so it would be nice to have recoil support in SAMCO (and further close the gap between it and Gun4IR).Perhaps it could be contributed to Prow7's fork, since it's more performant and supports some of the more powerful/bigger code space boards compared to the 32u4.

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #171 on: September 06, 2023, 10:06:54 pm »
Hi Guys, from my experience most of the emulators I use (PCSX2, pretty much everything in Recalbox) 2 guns at the same time isn't a problem with a bit of configuration. However I have heard of people having trouble in Teknoparot which does want an individual VID for each gun. If you need to you can do it by updated the board.txt file in Arduino for each gun. Found a tutorial here, if ya need it...

https://www.shellhacks.com/arduino-change-devices-vid-pid-name/

I have been doing a bit of coding lately working with a few other guys so hopefully some of those features that everyone been after for so long are too far off.

ThatOneSeong

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 63
  • Last login:Yesterday at 11:48:38 pm
  • Just your average Seong.
    • Twitter
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #172 on: September 10, 2023, 06:31:20 pm »
Hi Guys, from my experience most of the emulators I use (PCSX2, pretty much everything in Recalbox) 2 guns at the same time isn't a problem with a bit of configuration. However I have heard of people having trouble in Teknoparot which does want an individual VID for each gun. If you need to you can do it by updated the board.txt file in Arduino for each gun. Found a tutorial here, if ya need it...

https://www.shellhacks.com/arduino-change-devices-vid-pid-name/

I have been doing a bit of coding lately working with a few other guys so hopefully some of those features that everyone been after for so long are too far off.
You tease!  ;D Ah, but I look forward to it. I should be getting my second gun in tomorrow to do a custom mod, which should be fun.
On a sidenote, I did finally get around to upgrading my IR lights setup: borrowing from the GUN4IR spec, I tied together some high power black LED emitters, triplets of three tied to 5.6 ohm resistors each on a split power config, all run through one USB port on my TV. In lieu of proper mounting equipment I didn't have, to keep them steady I gutted the boards from the knockoff Wii sensor bars and put in the new boards - just needing some cable management and a bit of patience. Hacky, but eff it if it works. Pics here. I guess the plus side of this is I could also try GUN4IR at some point now?
But yeah, been super fun getting back to playing these games (again, again). Always happy to hear more's happening on this front, love to see good open source projects blossom.

dabone

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 898
  • Last login:October 31, 2023, 12:03:37 pm
  • Time to work...
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #173 on: October 24, 2023, 10:01:34 am »
Ok, another quick question.

Is it possible to do chorded key combos?
Like the ipac? i.e. press and hold select, and then press start = esc, but select and start having different values.


ThatOneSeong

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 63
  • Last login:Yesterday at 11:48:38 pm
  • Just your average Seong.
    • Twitter
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #174 on: October 24, 2023, 07:58:42 pm »
Ok, another quick question.

Is it possible to do chorded key combos?
Like the ipac? i.e. press and hold select, and then press start = esc, but select and start having different values.
Prow's fork uses button masks, which does exactly that (combinations of buttons access different functions). They're all hooked into different subroutines atm, but I imagine you could probably add one that sends an escape keypress. I myself have yet to try this.
UPDATE: if you're so interested in adding this (again, specific to the aforementioned Prow's fork), in the early section declaring the button combo masks, add:
Code: [Select]
// button combo to send an escape keypress
constexpr uint32_t EscapeKeyBtnMask = BtnMask_Reload | BtnMask_Start;
(Note: This is just an example for my Guncon 2-compatible gun, you could change the combination to whatever you like. Works best if the EnterPauseModeBtnMask is a different key combo, like BtnMask_Reload | BtnMask_Select

And then in the ExecRunMode function (the main code), preferably before the EnterPauseModeButtonMask, add:
Code: [Select]
        if(buttons.pressedReleased == EscapeKeyBtnMask) {
            Keyboard.releaseAll();                                  // Clear out keyboard keys (since Seong's default is pressing start, which is num1)
            delay(1);                                               // Wait a bit. Required for the escape keypress to actually register.
            Keyboard.press(KEY_ESC);                                // PUSH THE BUTTON.
            delay(100);                                             // Wait another bit. Required for the escape keypress to actually register, and mitigate sticking.
            Keyboard.release(KEY_ESC);                              // Aaaaand release.
        }
It should work. Granted, I've noticed the button combos need a few tries to register sometimes, but it'll activate after the last button in the sequence is pressed.

As an aside, I have been working on adding rumble motor and solenoid activation support to the fork myself. So far I have the former working for feedback when shooting off-screen (needs tuning just fixed it in fact!); with the latter coded up and ready in theory, but I'm still missing parts for the solenoid breakout board itself. Things keep getting lost in transit. :< But ideally, it should close the gap in functionality with GUN4IR.
« Last Edit: October 24, 2023, 11:35:45 pm by ThatOneSeong »

ThatOneSeong

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 63
  • Last login:Yesterday at 11:48:38 pm
  • Just your average Seong.
    • Twitter
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #175 on: October 30, 2023, 01:14:10 am »
In case anyone happens to be looking, I did make a little something and wanted to share that with everyone here.
I brought force feedback to SAMCO. (Based on Prow's work, just with my own additions and slight tweaks)


Currently, the gun being demo'd is having some EMI interference/disconnection issues so I couldn't demo as much as I'd like, but I'm redoing the wiring on my setup since it's using very low quality cables so it should be more stable on bigger gun builds. I just wanted to make something to close the gap on GUN4IR, and partially for my own enjoyment because of how much I loved the system made. I hope y'all won't mind?

RandyT

  • Trade Count: (+14)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 6882
  • Last login:March 26, 2024, 03:33:28 pm
  • Friends don't let friends hack keyboards.
    • GroovyGameGear.com
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #176 on: October 30, 2023, 04:19:11 pm »
Nice work on both the software updates and the gun build!

« Last Edit: October 30, 2023, 04:23:43 pm by RandyT »

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:November 28, 2023, 04:34:44 pm
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #177 on: October 30, 2023, 11:21:52 pm »
Very nice!!! Keep up the good work man :)

ThatOneSeong

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 63
  • Last login:Yesterday at 11:48:38 pm
  • Just your average Seong.
    • Twitter
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #178 on: October 31, 2023, 12:47:21 am »
Nice work on both the software updates and the gun build!
Thanks! Though it's definitely a build that looks better on the outside than in, and is kind of disgusting when you see the rats nest of cables...

You'd be surprised how tight everything was in this particular shell--and I had to design the mounts (and a fisheye adapter) from scratch, too! Just a whole lot of work - but when I got it working in the end, both the build and the mods, it was soooo satisfying.
Very nice!!! Keep up the good work man :)
Feel like I should be the one giving you the props! But thank you, truly.

EDIT [2023/11/01]: Updated the fork again, this time actually enabling EEPROM saving on the RP2040! Have tested and it works now on both my builds. Also fixed double feedback by reading the debounced trigger and not the pin state directly.
Still have to figure out the start/select buttons sticking on occasion, but it's at a very good state now at least...
« Last Edit: November 01, 2023, 03:53:01 pm by ThatOneSeong »

ThatOneSeong

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 63
  • Last login:Yesterday at 11:48:38 pm
  • Just your average Seong.
    • Twitter
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #179 on: November 02, 2023, 04:36:51 pm »
Posting again here! Since the last update, I've released v1.3 of the enhanced fork. This adds the option to send a different mouse button event when aiming off the screen, as well as ability to toggle the extra functionalities (rumble and solenoid) on and off from pause mode with button combinations. It also fixes the button responsiveness problems of the keyboard presses that were present in Prow's fork.
Granted, both that and the offscreen button option were done via hacky workarounds, since the LightgunButtons library that fork uses seems to have a hard time with the keyboard presses, but I've tested and it seems to be much better. As far as I know, that's most of the features now implemented in an open source project (and with less reflashing the board to change settings)!
« Last Edit: November 02, 2023, 11:35:48 pm by ThatOneSeong »