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

Poll

02/19 I will add RGB led support soon, I need for that to use 3 arduino PWM pins, which are currently being used by Pedal, Start & Right. I will do 2 firmwares, one with 11 buttons, and one with 8 button+led. How should they behave?

Leave the button pins as it is now, and disable the pedal, start and dpad right buttons when the RGB led is active
0 (0%)
Swap the pedal and start pins with some of the DPad ones, and disable only the DPAD when the RGB led is active
2 (50%)
Other (post a message to tell me what you think).
2 (50%)

Total Members Voted: 4

  

Author Topic: JayBee DIY 4 IR Led Lightgun System (no calibration needed)  (Read 40761 times)

0 Members and 3 Guests are viewing this topic.

Foxhole

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 249
  • Last login:Today at 07:11:12 am
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #360 on: February 16, 2020, 05:45:18 am »
* 2020/02/16 - 1.75
- fixed the combo buttons functions (joystick mode, offscreen shot...)
- reworked the buttons management to decrease risks of bugs and future-proof it
- did a lot of small optimization to increase the execution speed.
- changed the zip file, firmware name and flash bat again, now you can know which firmware you have, and choose between normal and test firmware. Please don't mix with the previous files.

@FoxHole
This update should fix the second issue you've been having ;)
Thanks, JayBee, i haven't fully tested this firmware yet but i did run into two issues that i haven't faced before.
First one is that i tried to recalibrate the sensor and after recalibrating, it didn't show the new value until i unplugged and replugged the usb.
Second one is related to the first one, after the calibration process, the trigger button is stuck, forcing unplugging and replugging of the usb.
Just to be clear, i used the same steps as on the first page to calibrate, Hold Cal Button -> shoot the cursor when it's on the middle -> press cal button again for brief moment.
I'll let you know about other issues if there are any.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 264
  • Last login:Today at 02:05:50 am
  • If I can't buy it, I build it.
    • Github
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #361 on: February 16, 2020, 06:15:05 am »
Thanks, JayBee, i haven't fully tested this firmware yet but i did run into two issues that i haven't faced before.
First one is that i tried to recalibrate the sensor and after recalibrating, it didn't show the new value until i unplugged and replugged the usb.
Second one is related to the first one, after the calibration process, the trigger button is stuck, forcing unplugging and replugging of the usb.
Just to be clear, i used the same steps as on the first page to calibrate, Hold Cal Button -> shoot the cursor when it's on the middle -> press cal button again for brief moment.
I'll let you know about other issues if there are any.
Thanks for the bug report!  :cheers:
Yes you are right, seems like the new button management is having some bugs with the calibration process.
Gonna fix that tonight!

Foxhole

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 249
  • Last login:Today at 07:11:12 am
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #362 on: February 16, 2020, 08:10:36 am »
Your idea with the RGB Led got me thinking. Do you think you could program the LED to blink when the gun is too close to the screen or too far?
That way when using it you won't need to mess around with the distance too much and make it easier to know where's the perfect distance.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 264
  • Last login:Today at 02:05:50 am
  • If I can't buy it, I build it.
    • Github
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #363 on: February 16, 2020, 09:16:55 am »
Your idea with the RGB Led got me thinking. Do you think you could program the LED to blink when the gun is too close to the screen or too far?
That way when using it you won't need to mess around with the distance too much and make it easier to know where's the perfect distance.
That would totally be possible once implemented!
And actually a great idea, I can make the led blink red when it has trouble picking up the leds correctly and when too far/too close.
I also want to use it in the test firmware, for instance to display a different color depending on the number of leds detected.

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 132
  • Last login:May 25, 2020, 07:23:11 am
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #364 on: February 16, 2020, 09:21:03 am »
Yes, it looks ok!  :applaud:
In the version 1.7 I restored the cursor accuracy, now it should be as smooth as before ;)
After covering the side walls of the cabinet in correspondence with the LEDs and moving them more towards the center including the upper ones (finally they have the same brightness) with the test firmware I have not encountered more recognition errors, no black or gray point . : D It works very well, with firmware 1.70 I finished Time Crisis without any error or false detection of the cursor ...: D Even with the Bezel glass, obviously I have to cover all the bright LEDs because if the gun points any light it detects a point black ... Would it be possible to implement something that stops ir detection when it goes directly below the lower leds? Another problem I have and has been doing since the first version is that sometimes pressing the A key causes the mame to switch to window mode.

https://photos.app.goo.gl/6uXxnmVPUGW2mBTW8


kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 132
  • Last login:May 25, 2020, 07:23:11 am
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #365 on: February 16, 2020, 07:36:08 pm »
OK! IRL540 mosfets have arrived, I have changed the connections, can you tell me if everything is ok? thank you very much :) rather arigato gozaimasu!!! :D

The circuit for the rumble works perfectly, this for the solenoid does not give me signs of life ... I have already verified that the 24v arrive at the circuit and I also changed the resistance of 10k with that of 100k thinking that was the problem ... does the solenoid work correctly if i connect it directly to the 24v power supply where am i wrong or what is missing? : D

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 264
  • Last login:Today at 02:05:50 am
  • If I can't buy it, I build it.
    • Github
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #366 on: February 16, 2020, 07:49:41 pm »
Yes, it looks ok!  :applaud:
In the version 1.7 I restored the cursor accuracy, now it should be as smooth as before ;)
After covering the side walls of the cabinet in correspondence with the LEDs and moving them more towards the center including the upper ones (finally they have the same brightness) with the test firmware I have not encountered more recognition errors, no black or gray point . : D It works very well, with firmware 1.70 I finished Time Crisis without any error or false detection of the cursor ...: D Even with the Bezel glass, obviously I have to cover all the bright LEDs because if the gun points any light it detects a point black ... Would it be possible to implement something that stops ir detection when it goes directly below the lower leds? Another problem I have and has been doing since the first version is that sometimes pressing the A key causes the mame to switch to window mode.

https://photos.app.goo.gl/6uXxnmVPUGW2mBTW8
Glad it's finally working for you!
Sadly there are no way of detecting unusual IR Points, the camera only detects 4 points at a time and doesn't know which is which.
The recognition is fully done in the Arduino.
Right now the Arduino resets the recognition every time is sees a led where it shouldn't see one, which helps correcting lot of errors.
But seeing those errors will still cause instability of the whole tracking system.

Envoyé de mon Pixel 3 en utilisant Tapatalk


JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 264
  • Last login:Today at 02:05:50 am
  • If I can't buy it, I build it.
    • Github
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #367 on: February 16, 2020, 07:52:38 pm »
OK! IRL540 mosfets have arrived, I have changed the connections, can you tell me if everything is ok? thank you very much :) rather arigato gozaimasu!!! :D

The circuit for the rumble works perfectly, this for the solenoid does not give me signs of life ... I have already verified that the 24v arrive at the circuit and I also changed the resistance of 10k with that of 100k thinking that was the problem ... does the solenoid work correctly if i connect it directly to the 24v power supply where am i wrong or what is missing? : D
Do you have a continuity tester or a multimeter to test every connection?
And did you try swapping the solenoid polarity?
If nothing works, I would recommend you to start fresh, on a new pcb, this one looks in pretty bad shape.

Envoyé de mon Pixel 3 en utilisant Tapatalk
« Last Edit: February 16, 2020, 07:55:29 pm by JayBee »

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 132
  • Last login:May 25, 2020, 07:23:11 am
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #368 on: February 17, 2020, 02:30:38 am »
Do you have a continuity tester or a multimeter to test every connection?
And did you try swapping the solenoid polarity?
If nothing works, I would recommend you to start fresh, on a new pcb, this one looks in pretty bad shape.
Yes, i have multimeter, how test every connection? I tested if the 24v came and ok, swapping the polarity too, and I redone the pcb with new components and using another solenoid, same problem, could you post some photos of the circuit you made? And tell me how to test the various connections? Thanks

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 132
  • Last login:May 25, 2020, 07:23:11 am
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #369 on: February 17, 2020, 04:36:46 am »


where's the error? It all seems correct to me as connections ... could it be the arduino pin that is not working at this point?
the solenoid directed to the power supply works..
I have no idea of ​​the problem otherwise... :dunno  :banghead:

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 264
  • Last login:Today at 02:05:50 am
  • If I can't buy it, I build it.
    • Github
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #370 on: February 17, 2020, 05:12:40 am »


where's the error? It all seems correct to me as connections ... could it be the arduino pin that is not working at this point?
the solenoid directed to the power supply works..
I have no idea of ​​the problem otherwise... :dunno  :banghead:
Where did you connect the solenoid power supply ground?

Envoyé de mon Pixel 3 en utilisant Tapatalk


kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 132
  • Last login:May 25, 2020, 07:23:11 am
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #371 on: February 17, 2020, 06:09:40 am »
Where did you connect the solenoid power supply ground?

between pin 2 of the mosfet and the diode



even if the solenoid pins have no polarity since as if I invert them it works
equally



« Last Edit: February 17, 2020, 06:15:36 am by kill_one »

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 132
  • Last login:May 25, 2020, 07:23:11 am
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #372 on: February 17, 2020, 06:25:02 am »
wait...should i also add gnd to the solenoid- wire?

in this way?


JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 264
  • Last login:Today at 02:05:50 am
  • If I can't buy it, I build it.
    • Github
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #373 on: February 17, 2020, 07:11:33 am »
No no, the solenoid connection is ok. I mean the 24v power supply ground ;)
Where is it connected?

Envoyé de mon Pixel 3 en utilisant Tapatalk


kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 132
  • Last login:May 25, 2020, 07:23:11 am
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #374 on: February 17, 2020, 07:29:23 am »
No no, the solenoid connection is ok. I mean the 24v power supply ground ;)
Where is it connected?

ah ok, the gnd of powersupply 24v it is connected to pin 3 of the mosfet and to the pin of the 100k resistor

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 132
  • Last login:May 25, 2020, 07:23:11 am
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #375 on: February 17, 2020, 08:05:18 am »
Arduino & Solenoid Power Supply gnd does it mean that you also need to connect an arduino gnd to the power supply 24v gnd ?
 

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 264
  • Last login:Today at 02:05:50 am
  • If I can't buy it, I build it.
    • Github
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #376 on: February 17, 2020, 10:17:54 am »
Yes of course you need to connect both ground together, without the Arduino ground there can't be any flow of current triggering the mosfet.

Envoyé de mon Pixel 3 en utilisant Tapatalk


kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 132
  • Last login:May 25, 2020, 07:23:11 am
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #377 on: February 17, 2020, 10:43:51 am »
Yes of course you need to connect both ground together, without the Arduino ground there can't be any flow of current triggering the mosfet.

so I have to take any Arduino gnd pin and connect it together to the 24v power supply gnd?

in this way:



it's correct ?

are the same also for the motor circuit?

because now it only works if I connect it to a USB port on the PC, if I connect it to an external power supply it doesn't work ... maybe because the PC works because it is also connected to another USB port?: D

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 264
  • Last login:Today at 02:05:50 am
  • If I can't buy it, I build it.
    • Github
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #378 on: February 17, 2020, 11:29:09 am »



so I have to take any Arduino gnd pin and connect it together to the 24v power supply gnd?

in this way:

it's correct ?

are the same also for the motor circuit?

because now it only works if I connect it to a USB port on the PC, if I connect it to an external power supply it doesn't work ... maybe because the PC works because it is also connected to another USB port?: D
Yes it looks correct.
Also yes, the Arduino ground always has to be connected, or else the current can't flow from the pin to the Arduino ground.
Since all USB ports usually share a common ground, that the Arduino is using, it indeed explains why it works when connecting both on the same pc.
But it's less than ideal as you can imagine ;)
So I guess if you fix this ground it should work.

Envoyé de mon Pixel 3 en utilisant Tapatalk


kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 132
  • Last login:May 25, 2020, 07:23:11 am
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #379 on: February 17, 2020, 11:52:04 am »
Yes it looks correct.
Also yes, the Arduino ground always has to be connected, or else the current can't flow from the pin to the Arduino ground.
Since all USB ports usually share a common ground, that the Arduino is using, it indeed explains why it works when connecting both on the same pc.
But it's less than ideal as you can imagine ;)
So I guess if you fix this ground it should work.

surely that will be the mistake then, tonight I will try ...: D

Will you also implement the ability to turn off the next vibration or recoil? It would be useful if used at night, because the solenoid makes a nice noise and the vibration in the long run could be annoying : D

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 264
  • Last login:Today at 02:05:50 am
  • If I can't buy it, I build it.
    • Github
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #380 on: February 17, 2020, 12:01:28 pm »


Yes it looks correct.
Also yes, the Arduino ground always has to be connected, or else the current can't flow from the pin to the Arduino ground.
Since all USB ports usually share a common ground, that the Arduino is using, it indeed explains why it works when connecting both on the same pc.
But it's less than ideal as you can imagine ;)
So I guess if you fix this ground it should work.

surely that will be the mistake then, tonight I will try ...: D

Will you also implement the ability to turn off the next vibration or recoil? It would be useful if used at night, because the solenoid makes a nice noise and the vibration in the long run could be annoying : D

Yeah it will be implemented too when I make a tool to configure the gun.
But right now you can still do it by using mamehooker and starting the serial mode, it bypasses any feedback as long as it's active.
Or like I do, you can just unplug the solenoid/motor power source if you have an easy to connect plug ;D
Didn't you have some switches on one of your guns? You could even use that.

Envoyé de mon Pixel 3 en utilisant Tapatalk


kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 132
  • Last login:May 25, 2020, 07:23:11 am
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #381 on: February 17, 2020, 12:49:52 pm »
Yeah it will be implemented too when I make a tool to configure the gun.
But right now you can still do it by using mamehooker and starting the serial mode, it bypasses any feedback as long as it's active.
Or like I do, you can just unplug the solenoid/motor power source if you have an easy to connect plug ;D
Didn't you have some switches on one of your guns? You could even use that.
yes there is an onoff switch but how should i connect it? : D
For mamehooker when will you release your configuration files? ;-)
« Last Edit: February 17, 2020, 12:52:06 pm by kill_one »

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 132
  • Last login:May 25, 2020, 07:23:11 am
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #382 on: February 17, 2020, 03:18:49 pm »
Ok! Now works! : D Even the motor now goes with USB power supply, is it normal for the Arduino to connect to the PC that the motor vibrates? And then I found this if you can check it too, when the gun is connected a single shot works correctly if I press once and it blows if I keep it pressed, if instead I disable the offscreen reload if I hold the trigger the engine starts. I attach the video for clarity :)
https://photos.app.goo.gl/GG1dY26B5tY9SB1f6


lightgungamer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 45
  • Last login:May 24, 2020, 02:54:40 am
  • I love playing Light Gun Games
    • LightgunGame.com
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #383 on: February 17, 2020, 04:32:41 pm »
HI Jaybee,

I finally got around to building this. I have the gun ready but I am having trouble flashing it.

At first I had an error when I ran the flashing program - "libusb0.dll" is missing from your computer".
 
I got round that by downloading libusb0.dll and puttng it in the dir with the bat file.
Then I got an error just saying:
avrdude application unable to start

So I downloaded and installed avrdude directly.

Now it runs but the batch file doesn't seem to work correclty as I get errors

---
Flash Normal or Test firmware (N: Normal/T: Test)?t
FIND: COM: No such file or directory
Invalid parameter - BAUD=1200

Waiting for 0 seconds, press CTRL+C to quit ...
FIND: COM: No such file or directory
No Instance(s) Available.

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "avrdude.conf"

         Using Port                    : -b57600
         Using Programmer              : avr109
avrdude: ser_open(): can't open device "-b57600": The system cannot find the file specified.


avrdude done.  Thank you.

Press any key to continue . . .
---

DO you have any ideas about what I might be doing wrong , or is ther another way of doing this?

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

Foxhole

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 249
  • Last login:Today at 07:11:12 am
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #384 on: February 17, 2020, 06:31:05 pm »
lightgungamer, make sure to have the drivers installed for your Arduino, and check in device manager - ports (COM & LPT) for the name of the Arduino. In the flash.bat it determines the com port by searching for the string 'Arduino' twice (the second one is for the bootloader), you need to change both to at least part of the name of your Arduino.
« Last Edit: February 17, 2020, 07:36:28 pm by Foxhole »

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 264
  • Last login:Today at 02:05:50 am
  • If I can't buy it, I build it.
    • Github
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #385 on: February 17, 2020, 07:49:08 pm »


Ok! Now works! : D Even the motor now goes with USB power supply, is it normal for the Arduino to connect to the PC that the motor vibrates? And then I found this if you can check it too, when the gun is connected a single shot works correctly if I press once and it blows if I keep it pressed, if instead I disable the offscreen reload if I hold the trigger the engine starts. I attach the video for clarity :)
https://photos.app.goo.gl/GG1dY26B5tY9SB1f6


Yes the motor vibrating once when plugged is normal, it's made to know it's plugged and started correctly ;)
Indeed for the fullauto mode I didn't change it even with the offscreen mode off, so it rumbles instead of using the solenoid.
I wonder what's the best tho when firing offscreen. Normally it rumbles to make you understand you're aiming off screen or reloading. Should it use the solenoid offscreen too when offscreen mode is disabled?

Envoyé de mon Pixel 3 en utilisant Tapatalk


JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 264
  • Last login:Today at 02:05:50 am
  • If I can't buy it, I build it.
    • Github
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #386 on: February 17, 2020, 07:58:03 pm »
DO you have any ideas about what I might be doing wrong , or is ther another way of doing this?

Thanks
Software needed:
  • Arduino IDE (this will just be needed to flash the firmware)
Don't install avrdude nor some dll, and don't change the installation files inside the zip file, just install Arduino IDE ;)

Edit: oh and you might also need to install the drivers for the pro micro Arduino inside the IDE, I don't remember if necessary or not.
I will add that to the main post.
« Last Edit: February 17, 2020, 08:06:41 pm by JayBee »

Foxhole

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 249
  • Last login:Today at 07:11:12 am
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #387 on: February 17, 2020, 08:22:41 pm »
JayBee, from my own experience with the promicro from sparkfun i had to install the drivers, and also had to change the %%arduino%% string to %%sparkfun%% otherwise it won't get detected at all.
After flashing your firmware the Arduino gets detected as Arduino leonardo but the boot loader is still named sparkfun, so after the flash i had to change only the second %%arduino%% string to %%bootloader%%
Furthermore i also had to change the timeout to 6 seconds instead of 3 otherwise it tries to flash too soon.
Of course, this will change per setup.
But i thought i should let you know because i had the same issues as lightgungamer, though in my case i had arduino ide installed and the drivers.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 264
  • Last login:Today at 02:05:50 am
  • If I can't buy it, I build it.
    • Github
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #388 on: February 17, 2020, 08:34:52 pm »
JayBee, from my own experience with the promicro from sparkfun i had to install the drivers, and also had to change the %%arduino%% string to %%sparkfun%% otherwise it won't get detected at all.
After flashing your firmware the Arduino gets detected as Arduino leonardo but the boot loader is still named sparkfun, so after the flash i had to change only the second %%arduino%% string to %%bootloader%%
Furthermore i also had to change the timeout to 6 seconds instead of 3 otherwise it tries to flash too soon.
Of course, this will change per setup.
But i thought i should let you know because i had the same issues as lightgungamer, though in my case i had arduino ide installed and the drivers.
Oh I see!
Yeah I think the bootloader on your model isn't the standard one, it's the one flashed by sparkfun.
I wonder if there is a risk in flashing a standard leonardo bootloader in it? Have you tried flashing anything from the arduino IDE?
I could give you my firmware with the bootloader included, but I don't want to risk frying your arduino :lol

Edit: Note that in the last flash bat file, I added %%bootloader%% too, but also left the %%arduino%% part in it.
I guess I should only leave %%bootloader%%.
So each bootloader takes a different timing to restart? I will try if mine works too with 6 seconds, if it works 6 second would then be more universally compatible.
« Last Edit: February 17, 2020, 08:49:30 pm by JayBee »

Foxhole

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 249
  • Last login:Today at 07:11:12 am
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #389 on: February 17, 2020, 08:36:16 pm »
No need, everything is working perfectly, no point risking damaging it.
As for Arduino ide, i think i only uploaded a sketch once or twice.
The sparkfun pro micro is very small and easy to fit in most gun shells, so it's a good choice, but i wish i could find something similar that has holes for mounting with screws, i don't like using hot glue or double sided tape.
« Last Edit: February 17, 2020, 08:40:15 pm by Foxhole »

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 264
  • Last login:Today at 02:05:50 am
  • If I can't buy it, I build it.
    • Github
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #390 on: February 17, 2020, 08:57:57 pm »
No need, everything is working perfectly, no point risking damaging it.
As for Arduino ide, i think i only uploaded a sketch once or twice.
The sparkfun pro micro is very small and easy to fit in most gun shells, so it's a good choice, but i wish i could find something similar that has holes for mounting with screws, i don't like using hot glue or double sided tape.
Yeah the sparkfun model is actually the same as the generic ones I use, but 3~4 times more expensive somehow :lol
Lately I've been considering using this model instead, for guns with limited space in them:

It should work as well as the big one.
« Last Edit: February 17, 2020, 09:02:35 pm by JayBee »

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 132
  • Last login:May 25, 2020, 07:23:11 am
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #391 on: February 17, 2020, 09:17:43 pm »


Ok! Now works! : D Even the motor now goes with USB power supply, is it normal for the Arduino to connect to the PC that the motor vibrates? And then I found this if you can check it too, when the gun is connected a single shot works correctly if I press once and it blows if I keep it pressed, if instead I disable the offscreen reload if I hold the trigger the engine starts. I attach the video for clarity :)
https://photos.app.goo.gl/GG1dY26B5tY9SB1f6


Yes the motor vibrating once when plugged is normal, it's made to know it's plugged and started correctly ;)
Indeed for the fullauto mode I didn't change it even with the offscreen mode off, so it rumbles instead of using the solenoid.
I wonder what's the best tho when firing offscreen. Normally it rumbles to make you understand you're aiming off screen or reloading. Should it use the solenoid offscreen too when offscreen mode is disabled?

Envoyé de mon Pixel 3 en utilisant Tapatalk
Ok for offscreen function but it behaves in the same way by pointing on the screen, if the offscreen_reload function is uninhabited, holding the trigger uses vibration instead of the solenoid also pointing to the center of the screen, I don't think that's right too?

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 264
  • Last login:Today at 02:05:50 am
  • If I can't buy it, I build it.
    • Github
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #392 on: February 17, 2020, 09:20:32 pm »
Ok for offscreen function but it behaves in the same way by pointing on the screen, if the offscreen_reload function is uninhabited, holding the trigger uses vibration instead of the solenoid also pointing to the center of the screen, I don't think that's right too?
indeed it's not normal, I will test tonight.

lightgungamer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 45
  • Last login:May 24, 2020, 02:54:40 am
  • I love playing Light Gun Games
    • LightgunGame.com
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #393 on: February 18, 2020, 06:35:32 am »
DO you have any ideas about what I might be doing wrong , or is ther another way of doing this?

Thanks
Software needed:
  • Arduino IDE (this will just be needed to flash the firmware)
Don't install avrdude nor some dll, and don't change the installation files inside the zip file, just install Arduino IDE ;)

Edit: oh and you might also need to install the drivers for the pro micro Arduino inside the IDE, I don't remember if necessary or not.
I will add that to the main post.

Hi Jaybee,

I did already have the Audrino IDE installed and have used it on other audrinos so it is working as well.
I will try those other suggestions out and report back.
Thanks
https://LightGunGamer.com - every Lightgun game and how to play them

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 264
  • Last login:Today at 02:05:50 am
  • If I can't buy it, I build it.
    • Github
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #394 on: February 18, 2020, 07:11:27 am »
Hi Jaybee,

I did already have the Audrino IDE installed and have used it on other audrinos so it is working as well.
I will try those other suggestions out and report back.
Thanks
Yeah you probably have to install the drivers that Foxhole suggested for your model ;)

lightgungamer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 45
  • Last login:May 24, 2020, 02:54:40 am
  • I love playing Light Gun Games
    • LightgunGame.com
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #395 on: February 18, 2020, 09:12:20 am »
I removed the installation of avrduse, removed the audrino ide and reinstalled it.

I have put the drivers for the pro micro which is the board I have on.
The batch file appears to find it at first but then after it starts, I just get the error "Unable to start Program"
Screen shot attached

Here is the output from the batch file:
---
Flash Normal or Test firmware (N: Normal/T: Test)?n

Status for device COM11:
------------------------
    Baud:            1200
    Parity:          None
    Data Bits:       8
    Stop Bits:       1
    Timeout:         OFF
    XON/XOFF:        OFF
    CTS handshaking: OFF
    DSR handshaking: OFF
    DSR sensitivity: OFF
    DTR circuit:     OFF
    RTS circuit:     ON


Waiting for 0 seconds, press CTRL+C to quit ...
Press any key to continue . . .
---
https://LightGunGamer.com - every Lightgun game and how to play them

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 264
  • Last login:Today at 02:05:50 am
  • If I can't buy it, I build it.
    • Github
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #396 on: February 18, 2020, 09:31:07 am »
* 2020/02/18 - 1.76
- reworked the buttons management again and fixed the remaining issues (with the calibration for instance)
- fixed the bug with the feedback when offscreen reload is disabled, now it should trigger the solenoid (the way it works remain unchanged when offscreen reload is enabled)
- modified the flashing batch file to be more compatible (detects bootloader whatever the model, and waits for 6 seconds now)

I removed the installation of avrduse, removed the audrino ide and reinstalled it.

I have put the drivers for the pro micro which is the board I have on.
The batch file appears to find it at first but then after it starts, I just get the error "Unable to start Program"
Screen shot attached

Here is the output from the batch file:
---
Flash Normal or Test firmware (N: Normal/T: Test)?n

Status for device COM11:
------------------------
    Baud:            1200
    Parity:          None
    Data Bits:       8
    Stop Bits:       1
    Timeout:         OFF
    XON/XOFF:        OFF
    CTS handshaking: OFF
    DSR handshaking: OFF
    DSR sensitivity: OFF
    DTR circuit:     OFF
    RTS circuit:     ON


Waiting for 0 seconds, press CTRL+C to quit ...
Press any key to continue . . .
---
Which version of windows and arduino IDE do you have?
You don't have any other arduino device plugged at the same time?
What happens if you try to flash an empty sketch in arduino IDE?
If flashing an empty sketch works, try replacing the avrdude.exe and avrdude.conf of my package by the ones in your own arduino folders:
Code: [Select]
C:\Users\<User folder>\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17Inside the bin and etc subfolders (replace the <User folder> by your own folder name)

Foxhole

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 249
  • Last login:Today at 07:11:12 am
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #397 on: February 18, 2020, 10:21:18 am »
JayBee, do you have any idea how much current the arduino takes from the usb?
I have a rumble motor that works on 5V 100ma, and i'd like it to use the same usb as the arduino as a power source, meaning i don't want it to use the arduino itself as the power source but tap to the existing usb wire.
If the arduino itself uses less than 400ma then it should be doable, question is, how?
edit: now that i think about it, using a usb3 port will allow it to work anyway, since the arduino won't use more than 500ma max.
So, the question is, how do i wire it all.
« Last Edit: February 18, 2020, 10:34:16 am by Foxhole »

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 264
  • Last login:Today at 02:05:50 am
  • If I can't buy it, I build it.
    • Github
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #398 on: February 18, 2020, 10:44:29 am »
JayBee, do you have any idea how much current the arduino takes from the usb?
I have a rumble motor that works on 5V 100ma, and i'd like it to use the same usb as the arduino as a power source, meaning i don't want it to use the arduino itself as the power source but tap to the existing usb wire.
If the arduino itself uses less than 400ma then it should be doable, question is, how?
I don't have a USB measurement tool, but from what I saw online and from my own experience, the power consumption of the Arduino itself is very low, only few mA.
For the 5V rumble motor, I power mine from the Arduino VCC pin, since the motor doesn't use too much current (the VCC seems to be connected directly to the USB VCC anyway).
Not sure it's 100% safe, since I haven't been able to find the max load the VCC pin can take, but it's way more convenient than splitting the usb cable.

edit: but if you want to power it from the USB directly, you have 2 solutions that should work equally well:
1. remove some of the USB cable plastic close from the micro usb plug, and hijack the VCC wire in it
2. buy or make a Y cable with 2 usb ports (more clean but take more space)

Edit2: oh, if by "how" you also means the circuit to control it from the Arduino pin, I made a schematic for it in the first post recently (with the list of components needed). For the rumble it's fairly easy to do   :D
« Last Edit: February 18, 2020, 12:29:43 pm by JayBee »

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 132
  • Last login:May 25, 2020, 07:23:11 am
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #399 on: February 18, 2020, 01:12:17 pm »
* 2020/02/18 - 1.76
- reworked the buttons management again and fixed the remaining issues (with the calibration for instance)
- fixed the bug with the feedback when offscreen reload is disabled, now it should trigger the solenoid (the way it works remain unchanged when offscreen reload is enabled)
- modified the flashing batch file to be more compatible (detects bootloader whatever the model, and waits for 6 seconds now)
Yeah!!! Top!!! :D