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 --- Bug Reports --- 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 30409 times)

0 Members and 1 Guest are viewing this topic.

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 37
  • Last login:October 11, 2020, 10:26:15 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: 1637
  • Last login:Today at 01:15:58 pm
  • 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: 262
  • Last login:Today at 01:32:30 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: 262
  • Last login:Today at 01:32:30 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: 37
  • Last login:October 11, 2020, 10:26:15 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: 37
  • Last login:October 11, 2020, 10:26:15 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: 37
  • Last login:October 11, 2020, 10:26:15 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: 37
  • Last login:October 11, 2020, 10:26:15 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: 37
  • Last login:October 11, 2020, 10:26:15 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: 18835
  • Last login:Today at 12:12:47 am
  • 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: 37
  • Last login:October 11, 2020, 10:26:15 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: 18835
  • Last login:Today at 12:12:47 am
  • 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: 37
  • Last login:October 11, 2020, 10:26:15 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:June 27, 2020, 08:12:47 am
  • 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: 55
  • Last login:October 18, 2020, 09:58:23 pm
  • 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: 37
  • Last login:October 11, 2020, 10:26:15 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: 55
  • Last login:October 18, 2020, 09:58:23 pm
  • 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: 2
  • Last login:Today at 10:25:18 am
  • 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: 2
  • Last login:Today at 10:25:18 am
  • 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: 37
  • Last login:October 11, 2020, 10:26:15 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: 37
  • Last login:Today at 10:55:24 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)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:October 20, 2020, 06:43:20 am
  • Time Crisis Gamer
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

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 37
  • Last login:October 11, 2020, 10:26:15 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: 37
  • Last login:Today at 10:55:24 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: 328
  • Last login:Today at 01:21:06 pm
  • If I can't buy it, I build it.
    • Github
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: 37
  • Last login:Today at 10:55:24 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: 37
  • Last login:October 11, 2020, 10:26:15 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: 37
  • Last login:Today at 10:55:24 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: 328
  • Last login:Today at 01:21:06 pm
  • If I can't buy it, I build it.
    • Github
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: 37
  • Last login:Today at 10:55:24 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:October 15, 2020, 03:51:54 am
  • 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: 37
  • Last login:October 11, 2020, 10:26:15 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: 37
  • Last login:Today at 10:55:24 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 »