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

Poll

-- deleted poll --

-- deleted poll --
0 (0%)
-- deleted poll --
0 (0%)

Total Members Voted: 0

  

Author Topic: GUN4IR - The Ultimate 4 Points Lightgun System  (Read 390937 times)

0 Members and 2 Guests are viewing this topic.

Endprodukt

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 688
  • Last login:November 14, 2023, 12:54:43 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #520 on: April 08, 2020, 10:20:25 am »
Ordered two. Getting excited over here.

Endprodukt

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 688
  • Last login:November 14, 2023, 12:54:43 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #521 on: April 08, 2020, 12:08:06 pm »
I've been doing experiments with some 1W 120 degrees leds from china.

The good news;
They work extremely well, from any angle, even from more than 45degrees on the side.
The good news;
They use a lot of energy, and produce a LOT of heat. Like way too much to use without a heat dissipating system or something.

I will try changing the resistors to see if I can reduce the heat, and add small metal frames to dissipate it.
If it works I think we can safely say that I found the perfect leds for this system :D

Did you keep looking into this? I'm in the market for IR Leds. That's why I'm asking.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #522 on: April 09, 2020, 06:43:40 am »

Did you keep looking into this? I'm in the market for IR Leds. That's why I'm asking.
I did, but haven't found a way yet to use them in an efficient and harmless way.
During my tests, one of the led became so hot it melted a hole in my TV screen border  :lol

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #523 on: April 09, 2020, 07:33:45 am »
* 2020/04/09 - 2.05 - unified firmware
- added rgb led autodetection, no need for 2 firmware now it should automatically detect if you have a rgb led or not, also avoiding a wrong flashing
- changed the offscreen/auto reload function to take less memory and run faster
- temporized the temperature sensor reading, it's checking only once every 2 seconds now
- fixed an issue with the 4:3 mode not working correctly on screen ratio lower than 4:3 (5:4 screens for instance)
- changed the IR led detection algorithm to detect each IR "blob" size, improving the way we can detect/filter the IR sources
- fixed the issue with the feedback still behaving the same when offscreen shoot mode is on
- fixed a wrong behavior of the solenoid in serial mode
- made some change on the serial commands to make them more universal and future-proof. please see the updated note on it
- updated the batch tool to fit the new firmware
- added an option in the batch tool to change the temperature sensor thresholds
- various fixes and optimizations
« Last Edit: May 07, 2020, 09:08:33 am by JayBee »

Endprodukt

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 688
  • Last login:November 14, 2023, 12:54:43 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #524 on: April 09, 2020, 03:00:00 pm »

Did you keep looking into this? I'm in the market for IR Leds. That's why I'm asking.
I did, but haven't found a way yet to use them in an efficient and harmless way.
During my tests, one of the led became so hot it melted a hole in my TV screen border  :lol

LOL oh boy! That's unfortunate. Yeah,

so I'm trying to find something equivalent to your specs, not so easy in Germany as it seems. At least 200mW I cannot find.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #525 on: April 09, 2020, 03:08:38 pm »

Did you keep looking into this? I'm in the market for IR Leds. That's why I'm asking.
I did, but haven't found a way yet to use them in an efficient and harmless way.
During my tests, one of the led became so hot it melted a hole in my TV screen border  :lol

LOL oh boy! That's unfortunate. Yeah,

so I'm trying to find something equivalent to your specs, not so easy in Germany as it seems. At least 200mW I cannot find.
My screen bravely suffered for the sake of science  :laugh2:
Yeah I know finding good IR LEDs is such a struggle.
What size of screen will you use? From what distance?
I might be able to give you more advices on finding the LEDs that suits your setup.

Endprodukt

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 688
  • Last login:November 14, 2023, 12:54:43 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #526 on: April 09, 2020, 03:30:27 pm »

Did you keep looking into this? I'm in the market for IR Leds. That's why I'm asking.
I did, but haven't found a way yet to use them in an efficient and harmless way.
During my tests, one of the led became so hot it melted a hole in my TV screen border  :lol

LOL oh boy! That's unfortunate. Yeah,

so I'm trying to find something equivalent to your specs, not so easy in Germany as it seems. At least 200mW I cannot find.
My screen bravely suffered for the sake of science  :laugh2:
Yeah I know finding good IR LEDs is such a struggle.
What size of screen will you use? From what distance?
I might be able to give you more advices on finding the LEDs that suits your setup.

Thanks for all the effort Mate!

Okay so I'm using a 25" Hantarex CRT (4:3). I'd say distance is like 3 feet or a bit more?

CanadianRyGuy

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 90
  • Last login:April 02, 2021, 07:41:53 am
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #527 on: April 09, 2020, 06:44:17 pm »
Hey Jaybee
Would you recommend any particular LEDs that are available on DigiKey.ca? I’m trying to source as much from one source to save on multiple shipping and hopefully get it to free shipping

These?
https://www.digikey.ca/product-detail/en/lumex-opto-components-inc/OED-EL-8L/67-1000-ND/270796

Spenser

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 1
  • Last login:May 29, 2020, 11:20:25 am
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #528 on: April 10, 2020, 11:56:12 am »
Hey Jaybee
Would you recommend any particular LEDs that are available on DigiKey.ca? I’m trying to source as much from one source to save on multiple shipping and hopefully get it to free shipping

These?
https://www.digikey.ca/product-detail/en/lumex-opto-components-inc/OED-EL-8L/67-1000-ND/270796

These may be a better option:
https://www.digikey.ca/product-detail/en/osram-opto-semiconductors-inc/SFH-4546/475-2870-ND/2205956

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #529 on: April 11, 2020, 01:05:31 am »
*2020/04/11 - 2.06
- fixed the rgb led detection that wasn't working properly. please update to this one especially if you have an rgb led or if you have a gun with dpad and/or start button.
« Last Edit: May 07, 2020, 09:08:44 am by JayBee »

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #530 on: April 11, 2020, 01:08:49 am »
Hey Jaybee
Would you recommend any particular LEDs that are available on DigiKey.ca? I’m trying to source as much from one source to save on multiple shipping and hopefully get it to free shipping

These?
https://www.digikey.ca/product-detail/en/lumex-opto-components-inc/OED-EL-8L/67-1000-ND/270796
4mW/sr is way too weak

These may be a better option:
https://www.digikey.ca/product-detail/en/osram-opto-semiconductors-inc/SFH-4546/475-2870-ND/2205956
better  ;)

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #531 on: April 13, 2020, 03:02:30 am »
* 2020/04/13 - 2.07
- add the right click offscreen shot mode back, now there are 3 modes we can cycle; lower left corner offscreen shot (default), right click offscreen shot, and disabled
« Last Edit: May 07, 2020, 09:08:53 am by JayBee »

Endprodukt

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 688
  • Last login:November 14, 2023, 12:54:43 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #532 on: April 15, 2020, 04:54:39 pm »
Just took the plunge on ordering two Time Crisis 4 type Lightguns with kickback from Ali. They don't come with the laser as they are made as replacement parts for the arcade, so no slaughtering will be going on.

I still couldn't find suitable LED's though. Meh.

Btw: TIP 102 to drive the solenoid should be fine I suppose? I use them with the aimtrak and they work for years.
« Last Edit: April 15, 2020, 04:57:16 pm by Endprodukt »

ryoken

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 74
  • Last login:October 15, 2022, 06:43:46 am
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #533 on: April 17, 2020, 01:02:38 am »
I just get the  ir camera today, and the first thing i see is orientation sticker says TOP, well i just run a tes on the pc to see the ir LEDs , and looks to me this df robotic  camera the wider angle at the vertical axis,  is possible to rotate the camera 90 degrees?

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #534 on: April 17, 2020, 01:44:52 am »
I just get the  ir camera today, and the first thing i see is orientation sticker says TOP, well i just run a tes on the pc to see the ir LEDs , and looks to me this df robotic  camera the wider angle at the vertical axis,  is possible to rotate the camera 90 degrees?
It's a well known issue that most df robot camera are tilted (top should be turned 90 degrees on the right side).
it's easy to see if it's tilted or not with the test app, if you move horizontally and the leds move vertically onscreen for instance.

Just took the plunge on ordering two Time Crisis 4 type Lightguns with kickback from Ali. They don't come with the laser as they are made as replacement parts for the arcade, so no slaughtering will be going on.

I still couldn't find suitable LED's though. Meh.

Btw: TIP 102 to drive the solenoid should be fine I suppose? I use them with the aimtrak and they work for years.
from which seller did you buy it? I ordered one too but it came without the solenoid (so totally useless), had to do a claim and they sent me the solenoid assembly (still waiting for it)
the TIP102 seems fine indeed  ;)

Endprodukt

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 688
  • Last login:November 14, 2023, 12:54:43 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #535 on: April 17, 2020, 08:50:02 am »
SQ Arcade. About 90 bucks for one. How's the quality of the shell? Did you find a good part for the microswitch?

If you could link me to any AliExpress ir LEDs that should work I'd be super thankful.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #536 on: April 17, 2020, 09:11:29 am »
SQ Arcade. About 90 bucks for one. How's the quality of the shell? Did you find a good part for the microswitch?

If you could link me to any AliExpress ir LEDs that should work I'd be super thankful.
Not the same seller as mine, that's good!

I actually received the solenoid today, and mounted it to check.
The quality is decent, you can feel a bit it's not the original but it still seems sturdy enough.
And the solenoid is very strong, way stronger than any of the ones I tried so far, which isn't really surprising.
For the trigger microswitch, the reference I found is the Omron SS-01GL2T, which I ordered, but I guess any switch with a similar specs would work?
I will post pics of it once I installed it on the discord server.

For the IR leds reference (and the installation tutorial, I put everything on the discord server too ;)

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #537 on: April 18, 2020, 07:49:25 am »
* 2020/04/18 - 2.09
*note: from now on the firmware updates will be in my github
https://github.com/JayBee-git/IR_Light_Gun/tree/master/JayBee_4leds_Light_Gun
- add nunchuck support, you can now connect a wiimote nunchuck on the i2c port (with a logic level converter board, since it works in 3.3v)
- split the firmware in normal and test versions again, to get enough space for wiimote support
- improved both test firmware and test pde to show the buttons state, and trigger the solenoid and rumble with trigger and A button respectively

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #538 on: April 30, 2020, 12:09:17 pm »
*2020/04/30 - 2.16
- fixed a small bug that prevented the temperature sensor to be read

* 2020/04/30 - 2.15
- big rewriting/update of the detection process, now it's lighter, faster and more stable
- better perspective correction, now it should be more accurate on the screen sides
- code cleanup and optimization
- fixed a bug in the camera calibration, it should now work better
- merged the test and normal firmware again, thanks to the optimization
- added various update to make it compatible with the upcoming UI
- updated the IR cam test pde to match the changes
- to win space and make it more stable, I had to reduce the tilt support to around 45°. It should however not impact it too much since the tilt more than 45° wasn't completely stable anyway

https://github.com/JayBee-git/IR_Light_Gun/releases/tag/2.16

ryoken

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 74
  • Last login:October 15, 2022, 06:43:46 am
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #539 on: May 02, 2020, 05:39:55 am »
Very nice, thanks for  sharing  bro

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #540 on: May 04, 2020, 12:31:11 pm »
New big update, I made a GUI for the gun!

Since both the firmware and this GUI required countless of work to make, the GUI is for donators only.
Of course you can also still use the firmware alone if you prefer, it's up to you  :cheers:

Here are some of its functions:
- Offset/calibration wizard or manual setting
- Button remap
- IR sensor, buttons and feedback testing
- Change any gun settings
- Save/Load gun profiles
- Firmware flashing
- Many more...

Firmware changes in v2.22 to go along with the GUI:
- The firmware now comes in 4 flavors, each with its own PID, to be able to keep each device assigned to the correct player
- Calibration and test modes now interact with the UI

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #541 on: May 06, 2020, 03:08:50 am »
*2020/05/06 - GUI v0.86 beta
- added support for the Arduino Micro model
- added Arduino Micro firmware (so we now have 8 different ids)
-updated drivers for Arduino Micro

And that's the specific model you would need, with 3v3 and A8 pins (they don't always have it)
« Last Edit: May 07, 2020, 09:10:23 am by JayBee »

Xavilend

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:June 21, 2020, 07:22:37 am
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #542 on: May 06, 2020, 11:24:23 am »
Been diving into all this information and I'm loving what I see. Me and the kids are looking forward to building our own gun for the arcade. Would a Namco PS1 NPC-103 be a good starting point for this setup? Thanks in advance

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #543 on: May 06, 2020, 03:39:49 pm »
Been diving into all this information and I'm loving what I see. Me and the kids are looking forward to building our own gun for the arcade. Would a Namco PS1 NPC-103 be a good starting point for this setup? Thanks in advance
Yes, I built one of my gun out of a Guncon too, it's very nice since the camera we are using fits perfectly inside the barrel.
Come and join the discord server if you need more details  ;)

Xavilend

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:June 21, 2020, 07:22:37 am
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #544 on: May 07, 2020, 10:59:53 am »
That's perfect, thank you. I'm taking my time. Ordered that gun from eBay and found someone who can 3Dprint me a trigger/switch mod, will order the electronics tomorrow. So far so good!

It's amazing work that you're doing. We built an arcade machine and it's killing me that we can't play the classic gun games. All in good time I guess!

manhunt

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:March 21, 2024, 11:03:11 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #545 on: May 08, 2020, 11:21:53 pm »
The project is very good and has been studying and researching, PS1 Namco guncon is very suitable

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #546 on: May 11, 2020, 12:32:48 am »
Update: in light of some recent events, and after a lot of thinking, I decided to limit licenses to my software to people that donate at least 10$ and have a clear history in this forum.
I won't be giving any more license to people who just arrive here and people who donate less.
Please remember that I invested so much money and time in this project, that even if all users give me 10$ I still won't make any money out of it, this measure is mostly for security purposes, and fairness.

Also I'm always here to help users that are building this system, but because I don't have much free time anymore, I won't be giving any more personal technical support to anyone who doesn't match the said criteria.

If you are new or don't want to give any money, remember that the base firmware without the app is still totally free, and share with other users  :cheers:

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #547 on: May 13, 2020, 12:31:13 am »
*2020/05/13 - GUI v0.88 beta
- added a better error handling system to get error codes I can decode if something happens in the app. It will help a lot with troubleshooting.

Ratafia82

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:June 01, 2020, 01:36:22 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #548 on: May 18, 2020, 09:23:03 am »
Thank you very much for this great work!!  :applaud: :applaud: :applaud:

I'm doing my own lihtgun and I began to implement my sketch for Arduino using your old code for 2 IR Leds to calculate the relative position of the mouse in a Adafruit nRF528 board with bluetooth. However, I have a lot of problems to get a stable position of the mouse in the screen. I can give you my sketch if you have curiosity.

I wonder if you will deliver the new code for 4 leds in any moment. I'm interested in it to implement parts of your code in my own lightgun. Would it be possible that you can give me part of this code to implement it in my project? I will donate some dollars if you need.

It is a personal work and I would never give this code to anyone.

Is it possible to achieve this??

You can send me a private message if you want!

Thank you very much again!

Amazing work! 

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #549 on: May 19, 2020, 07:37:08 am »
Thank you very much for this great work!!  :applaud: :applaud: :applaud:

I'm doing my own lihtgun and I began to implement my sketch for Arduino using your old code for 2 IR Leds to calculate the relative position of the mouse in a Adafruit nRF528 board with bluetooth. However, I have a lot of problems to get a stable position of the mouse in the screen. I can give you my sketch if you have curiosity.

I wonder if you will deliver the new code for 4 leds in any moment. I'm interested in it to implement parts of your code in my own lightgun. Would it be possible that you can give me part of this code to implement it in my project? I will donate some dollars if you need.

It is a personal work and I would never give this code to anyone.

Is it possible to achieve this??

You can send me a private message if you want!

Thank you very much again!

Amazing work!
Thanks  ;)

Why would you want to calculate the relative coordinates of the mouse instead of absolute? Why inflicting that to yourself?  :lol
To be honest there is currently no way to have a reliable relative mouse calculation for something with absolute coordinates like lightguns. Not unless you want to have to recalibrate it every time you plug it in.

To answer to your question, I'm not planning to open my code anytime soon, nor share it to anyone.

Ratafia82

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:June 01, 2020, 01:36:22 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #550 on: May 19, 2020, 11:58:06 am »
Thank you very much for this great work!!  :applaud: :applaud: :applaud:

I'm doing my own lihtgun and I began to implement my sketch for Arduino using your old code for 2 IR Leds to calculate the relative position of the mouse in a Adafruit nRF528 board with bluetooth. However, I have a lot of problems to get a stable position of the mouse in the screen. I can give you my sketch if you have curiosity.

I wonder if you will deliver the new code for 4 leds in any moment. I'm interested in it to implement parts of your code in my own lightgun. Would it be possible that you can give me part of this code to implement it in my project? I will donate some dollars if you need.

It is a personal work and I would never give this code to anyone.

Is it possible to achieve this??

You can send me a private message if you want!

Thank you very much again!

Amazing work!
Thanks  ;)

Why would you want to calculate the relative coordinates of the mouse instead of absolute? Why inflicting that to yourself?  :lol
To be honest there is currently no way to have a reliable relative mouse calculation for something with absolute coordinates like lightguns. Not unless you want to have to recalibrate it every time you plug it in.

To answer to your question, I'm not planning to open my code anytime soon, nor share it to anyone.


Thank you for your reply!

I think I was confused in my previous post. I see this comment in your old code and I sure misunderstood the meaning. You are right! It is essential to use absolute positioning of mouse. I use it like this. My really question was about the math formula to calculate the new position of the leds when the gun is moving, something like these:

 finalX = (int)(512.0 + cos(atan2(twoY - oneY, twoX - oneX) * -1.0) * (((oneX - twoX) / 2.0 + twoX) - 512.0) - sin(atan2(twoY - oneY, twoX - oneX) * -1.0) * (((oneY - twoY) / 2.0 + twoY) - 384.0) + 0.5);
      finalY = (int)(384.0 + sin(atan2(twoY - oneY, twoX - oneX) * -1.0) * (((oneX - twoX) / 2.0 + twoX) - 512.0) + cos(atan2(twoY - oneY, twoX - oneX) * -1.0) * (((oneY - twoY) / 2.0 + twoY) - 384.0) + 0.5);

As you know these are to calculate the position when IR camera detects 2 leds. My wish was to obtain the formula to detect 4 leds, 3 leds, etc.

I had to try it!! But I really understand your position of not sharing.

I think that I will back to the samco system with the two wii bars. I will take less pain!  :dizzy:  :lol

Despite all, thank you very much for your great contributions!! And Good luck with your project!!  ;) ;)

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #551 on: May 20, 2020, 12:05:05 am »
Thank you for your reply!

I think I was confused in my previous post. I see this comment in your old code and I sure misunderstood the meaning. You are right! It is essential to use absolute positioning of mouse. I use it like this. My really question was about the math formula to calculate the new position of the leds when the gun is moving, something like these:

 finalX = (int)(512.0 + cos(atan2(twoY - oneY, twoX - oneX) * -1.0) * (((oneX - twoX) / 2.0 + twoX) - 512.0) - sin(atan2(twoY - oneY, twoX - oneX) * -1.0) * (((oneY - twoY) / 2.0 + twoY) - 384.0) + 0.5);
      finalY = (int)(384.0 + sin(atan2(twoY - oneY, twoX - oneX) * -1.0) * (((oneX - twoX) / 2.0 + twoX) - 512.0) + cos(atan2(twoY - oneY, twoX - oneX) * -1.0) * (((oneY - twoY) / 2.0 + twoY) - 384.0) + 0.5);

As you know these are to calculate the position when IR camera detects 2 leds. My wish was to obtain the formula to detect 4 leds, 3 leds, etc.
Yeah this calculation is very old, unoptimized and doesn't work well, even for the 2 points calculation.
For the 2+ points calculation, there is far more to it than just formula. It's a mix of codes and very advanced algebra.

I had to try it!! But I really understand your position of not sharing.

I think that I will back to the samco system with the two wii bars. I will take less pain!  :dizzy:  :lol

Despite all, thank you very much for your great contributions!! And Good luck with your project!!  ;) ;)

No problem, whatever suits you best  ;)

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #552 on: June 20, 2020, 12:24:16 pm »
A cool video made by Foxhole on Point Blank, to show the system accuracy  8)

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #553 on: June 21, 2020, 03:38:05 am »
Another video I just made in pov to show the pinpoint accuracy of this system:

Note that the latency in the video is mainly caused by my test app and my screen, the latency in-game is lower.

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9226
  • Last login:March 25, 2024, 08:10:48 pm
  • ...
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #554 on: June 21, 2020, 06:25:03 am »
Another video I just made in pov to show the pinpoint accuracy of this system:

Note that the latency in the video is mainly caused by my test app and my screen, the latency in-game is lower.
I commend you sir on a properly done lightgun accuracy demonstration.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #555 on: June 21, 2020, 06:59:28 am »
I commend you sir on a properly done lightgun accuracy demonstration.
Thanks  ;D

Here is another small demo ingame this time, in the house of the dead 3 windows version. I left the crosshair for precision demo only.

The quality isn't the best nor the easiest to capture from my phone cam, but it works  :lol
« Last Edit: June 21, 2020, 07:02:24 am by JayBee »

ryoken

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 74
  • Last login:October 15, 2022, 06:43:46 am
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #556 on: June 22, 2020, 03:26:21 am »
My favorite lightgun is the one you make, JB infinity  thanks for sharing,  i have  a blast with my JB lightgun  since i built my own

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #557 on: June 22, 2020, 04:26:55 am »
My favorite lightgun is the one you make, JB infinity  thanks for sharing,  i have  a blast with my JB lightgun  since i built my own
Thanks a lot Ryoken, I'm very happy to hear that  :cheers:
Show us your setup if you can sometime ;)

cybermat

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 29
  • Last login:June 05, 2023, 08:27:39 am
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #558 on: June 29, 2020, 04:46:25 am »
Hello, i'm gonna buy these IR LEDS

https://www.everlight.com/file/ProductFile/IR333-A.pdf

Could you please tell me if they are good for 1/1.5 meter distance and what kind of resistence should i put ? I don't know how to populate the voices provided in the specs into this site http://led.linear1.org/led.wiz sorry :(

Thanks

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9394
  • Last login:Today at 01:01:08 pm
  • Designated spam hunter
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #559 on: June 29, 2020, 06:29:45 am »
Hello, i'm gonna buy these IR LEDS

https://www.everlight.com/file/ProductFile/IR333-A.pdf

Could you please tell me if they are good for 1/1.5 meter distance and what kind of resistence should i put ? I don't know how to populate the voices provided in the specs into this site http://led.linear1.org/led.wiz
Looks like that datasheet has some conflicting info on pg 3.   :dizzy:
Absolute Maximum Ratings table:
  "Continuous Forward Current  IF  100 mA" -- no restrictions noted for 100 mA continuous use.

Electro-Optical Characteristics table:
  Voltage forward "IF=100mAPulse Width≦100μs ,Duty≦1%" -- major restrictions on pulse width (how long it is on) and duty cycle (% of total time it is on) for 100 mA operation.
------------------
Here are some safe values to enter in the LED calculator.

Source voltage:  5
- I assume you'll be running these with 5v.  Enter "12" for 12v.

Diode forward voltage:  1.2
- The table on pg 3 lists several possible VF values.
-- 1.2v will give you a continuous 20mA current draw with no restrictions on pulse width or duty cycle so this is a safe value to use.
-- The other values have major restrictions on pulse width and duty cycle.

Diode Forward Current (mA):  20
- The other values have major restrictions on pulse width and duty cycle.

Number of LEDs in your array:   :dunno
- Not sure how many LEDs you will want/need.

View output as: Wiring diagram


Scott
« Last Edit: June 29, 2020, 06:31:29 am by PL1 »