Nice work JayBee, can't wait to check out your code.Actually this time I'm not sure I will share the source code yet, for ease of use, update and prevent any problem.
I was wondering is the reason you mentioned you have to stand in front of the screen to fie because of the tight angle of the leds? Just because I've looked around and found some wide angle leds on AliExpress https://www.aliexpress.com/item/32491780864.html?spm=a2g0s.9042311.0.0.41bf4c4dNxe3jj they don't have UV coating on them so wouldn't suggest for everyday unless you want to mount them behind a UV filter (or even better eventually find some that already have it like the Adafruit ones). But these increase the viewing angle massively.
Good news, thanks to Howard_Casto and his Mamehooker software, I was able implement mame output with my lightgun. I can send recoil, rumble and led control and parameters directly to the guns for each game independently.:applaud: :applaud: :applaud:
For the games/emulators that support output, the solenoid, rumble motor or led that you have installed in your gun will react like in the real arcade machine.
It will also be very easy to customize.
And since it's switching the games automatically, for games that don't support output, the recoil, rumble and led will go back to be controlled by the Arduino.
This is very close to complete!
Next, I will add a way of checking the solenoid temperature with a small chipset, to modify its speed of actuation if getting too hot, and avoid frying it.
It could also allow you to continue to fire in full auto but with reduced speed as long as the solenoid is hot.
You got it done before I even had a chance to sit down and work on it. :afro:It wasn't so hard, your tool makes things so much more simple :cheers:
What type of interface did you use?
One thing I would suggest would be to add a pulse mode to your code..... 99% of the mame and model 2 library pulse the output for you with games like terminator 2, ect., but If I remember correctly Operation Wolf just has a steady on when the gun is firing. It has to do with the mechanical operation of the guns... (op wolf and a couple others use a motor spinning a piston instead of a solenoid). I have the outputs mapped for the model 2 emulator and some of the pc/techno parrot stuff as well, but I haven't released an updated troubleshooter 2 yet.
Honestly getting m2emulator ready to run with mamehooker is a giant pain in the butt, mostly because I'm getting it to do something it isn't supposed to do. I'm working on it though.Yeah I guess it has to be very hacky to get support in m2, like memory read and stuff? looks like a huge headache to make that work :-\
Yeah getting the pulse synced up is an issue. Wait commands can be used to hold the solenoid open a bit longer so things can be slowed down somewhat, but that's about it. I guess finding a solenoid that fires at the same rate as some of the positional guns would be the ideal solution, but I don't know how hard that would be.
I can send you the Arcade Guns Aimforce dongle software to look at if it would be helpful?It is technically possible to activate the solenoid at the right frequency with Mamehooker and my arduino code, with a 3-5ms precision, but unless we have the matching solenoid for each game, the activation/hold/release/pause timings will not match my solenoid, and won't work or make it overheat. It's not really an issue with games without variable speed full auto, where speed of solenoid activation doesn't matter so much.
It looks like they borrowed some of your work with mame hooker and added their own front end with some additional options. It essentially allows you to set up recoil for each game individually including the type of recoil (auto or semi) and the speed of recoil. It works with any gun game including Model 2 and 3. Plus, it also has a hooker option to take instructions from the game like mame hooker, and space to add your own code.
Changing the speed of a solenoid should just be a case of changing the frequency. I do it manually with a pot on my ne555 board. I use the 0-50hz jumper and then turn the pot until I get roughly 6-10 activations per second. I assume this would be possible to set any solenoid to the right speed for the game in software with the right know how.
OK I understand the issue now. T2 doesn't just change recoil speed for heat control though. It changes for different guns you pick up along the way too. A number of arcade games do this. I noticed it on the Jurassic Park (Raw Thrills version) too. It would be awesome to be able to replicate that feature. Recoil should pick up the pace if you grab a gatling gun in-game.... Have you managed to make this work?I'm not using arcade fun solenoids, just the cheap one with enough strength that fits in the gun. I know what you are going to say, but I'm very happy with those ;)
I haven't seen any arcade guns that have a heat sensor inside. I'd be interested to hear how you'd make the game change recoil speed based on the output from the heat sensor. I'm not sure how much difference it will make in practice though.
My experience has been that full auto arcade recoil gun solenoids don't dangerously overheat, even after a long play session. That is, assuming they are set up right. They are made to take a hammering all day every day so typical home play doesn't really tax them. I spent over two hours playing Time Crisis 3 and Crisis Zone yesterday and my Time Crisis arcade gun solenoid was barely warm. It's the same with my Op Thunderbolt and Gen X guns (if I keep the pistons oiled).
If a solenoid is getting dangerously hot during regular play then I'd assume it was either the wrong type of solenoid or it was set up wrong (too much power or a duty cycle that's too high). Either way, I'd want to stop using it all together and let it cool down properly instead of reducing the frequency. When I tested my Aimtrak solenoid with full auto, after three minutes of play, it got hot enough to burn my fingers and melt the surrounding wires. This was using the same 555 circuit (with the same frequency) as I use for my arcade gun solenoids. It taught me an expensive lesson.
It's important to know if you have a momentary or continuous duty solenoid. Momentary solenoids (like the one in the Aimtrak) usually pack more force but require cool down time between activations and shouldn't stay activated for more than a second or two. Continuous duty solenoids are designed to say activated for longer periods of time (without burning up the coil). They usually pack less force but they generate less heat and are more suitable for full auto.
Have you experienced over-heating issues with full auto arcade gun solenoids? If so, I'd be interested to hear which guns had issues and what frequency you used?
The only affordable quality recoil solenoid I know of is the one for Terminator Salvation arcade guns. There aren't many arcade companies left these days but Raw Thrills parts are generally far more reasonable than Namco and Sega parts. They can be found for a little over $30. If a person can't afford $30, my suggestion would be to not spend anything on gaming peripherals at all until they can.As I already told you, none of the options you suggest are available here in Japan where I live.
The other cheap option, and probably the one I would recommend for a project, is a used PS1 jolt gun. They have a decent full auto solenoid and you benefit from also getting a shell designed to fit it. It saves a lot of time and wasted cash.
The issue with cheap solenoids over-heating isn't just that they get hot. If you can feel a noticeable amount of heat building up in a properly lubed solenoid, it's because you are burning up the coil. In other words, it won't last long. I destroyed a bunch of "cheap" solenoids before I realized that it was cheaper to just buy one that was suitable for the job. Ultimately, you want to be able to play without worrying about this stuff, or it's not fun.
I spent a good amount of time searching for decent continuous duty pull solenoids on ebay a while ago. They can be found but the saving over the Raw Thrills solenoids is usually too small to matter.
I can't honestly criticize what you are trying to do with the cheap eBay solenoids as I tried to do the same and for the same reasons. I'm almost 100% sure that you'll eventually come to the same conclusion though.
It's more like saying "regardless if you plan to use the car once per month or every day, you should get one with brakes that work". And, "if you can't afford a car with working brakes, it's better to get nothing at all".The jolt gun I found + sending fees was more than 100$ in total.
I don't live in Japan or know the market there but I don't believe that it's not possible to buy a continuous duty solenoid. Especially as some of the solenoid brands I've seen are Japanese companies. Plus, there is a bunch of low cost arcade parts sellers that are based in Asia and ship internationally. And, there are plenty of ebay sellers who ship internationally. I order stuff from Japanese sellers all the time. I'm sure that if you kept an eye on ebay, you'll find a jolt gun from a seller who'll ship to Japan.
Also, Namco, a Japanese company, sell new Time Crisis 4 gun shells and recoil solenoids for $120 in America. I'm sure they will have a parts distributor for their home market and that it wouldn't be significantly more expensive which means, if you know where to look, there will be used parts selling for less.
This looks great. Can’t wait to get it built and try it out.Yeah, I should be adding schematics and pictures of everything tomorrow ;)
It's more like saying "regardless if you plan to use the car once per month or every day, you should get one with brakes that work". And, "if you can't afford a car with working brakes, it's better to get nothing at all".The jolt gun I found + sending fees was more than 100$ in total.
I don't live in Japan or know the market there but I don't believe that it's not possible to buy a continuous duty solenoid. Especially as some of the solenoid brands I've seen are Japanese companies. Plus, there is a bunch of low cost arcade parts sellers that are based in Asia and ship internationally. And, there are plenty of ebay sellers who ship internationally. I order stuff from Japanese sellers all the time. I'm sure that if you kept an eye on ebay, you'll find a jolt gun from a seller who'll ship to Japan.
Also, Namco, a Japanese company, sell new Time Crisis 4 gun shells and recoil solenoids for $120 in America. I'm sure they will have a parts distributor for their home market and that it wouldn't be significantly more expensive which means, if you know where to look, there will be used parts selling for less.
Arcade parts here are actually more expensive and hard to come by than outside of Japan, thanks to the high demand of arcade centers that are everywhere here, that would pay any price to get their parts.
Plus none of those gun part shop is open to the public, only people with an arcade company can order. They are protective of their market and tech.
So getting official part would be very expensive for me AND extremely troublesome.
But if you can show me some model of continius duty solenoid you think are good and than can fit in my guns, I will gladly take a look at it.
I think I already told you, jolt gun delivery fees to Japan are >50$, and for the last time, I am not interested in buying those, I am very happy with my current guns, thanks.It's more like saying "regardless if you plan to use the car once per month or every day, you should get one with brakes that work". And, "if you can't afford a car with working brakes, it's better to get nothing at all".The jolt gun I found + sending fees was more than 100$ in total.
I don't live in Japan or know the market there but I don't believe that it's not possible to buy a continuous duty solenoid. Especially as some of the solenoid brands I've seen are Japanese companies. Plus, there is a bunch of low cost arcade parts sellers that are based in Asia and ship internationally. And, there are plenty of ebay sellers who ship internationally. I order stuff from Japanese sellers all the time. I'm sure that if you kept an eye on ebay, you'll find a jolt gun from a seller who'll ship to Japan.
Also, Namco, a Japanese company, sell new Time Crisis 4 gun shells and recoil solenoids for $120 in America. I'm sure they will have a parts distributor for their home market and that it wouldn't be significantly more expensive which means, if you know where to look, there will be used parts selling for less.
Arcade parts here are actually more expensive and hard to come by than outside of Japan, thanks to the high demand of arcade centers that are everywhere here, that would pay any price to get their parts.
Plus none of those gun part shop is open to the public, only people with an arcade company can order. They are protective of their market and tech.
So getting official part would be very expensive for me AND extremely troublesome.
But if you can show me some model of continius duty solenoid you think are good and than can fit in my guns, I will gladly take a look at it.
It sucks to be in Japan (for light gun fans)....
You should be able to find one cheaper than that though. I can order a jolt gun right now off ebay for $35 delivered. For you, it's probably best to search for UK sellers. These guys will send me this PS1 recoil gun from the UK for less than $30 delivered:
https://www.ebay.com/itm/Playstation-2-SATURN-SILVER-AVENGER-PRO-LIGHT-GUN-CONTROLLER-PS2/333345578110?hash=item4d9cf1dc7e:g:120AAOSwnD1dkejz
There is usually a lot of jolt guns there. If you put an offer in for ones like this, I'm sure they'll take it:
https://www.ebay.com/itm/Pistola-Gun-per-Playstation-1-PS1-e-Sega-Saturn-con-pedale-Funzionante/303335038088?hash=item46a02d5c88:g:MKcAAOSw~KpcduNN
In terms of solenoid models, just add the word "continuous" to an ebay search for pull solenoid, or check the specs for Duty cycle: Continuous.
Thanks, @JayBee @Samco @Hifi and all others involved, you're awesome!I didn't know you could use the wiimote IR cam, that's really cool! Yeah if you can show us more about that, I would gladly test it too.
After retrofitting my old trusty sluh-00017 Konami Justifier with the JayBee 2 point software, i stumbled upon Hifi's software and actually started to make the same.
but now i found this, so i guess its not needed anymore.
Though i tried to implement the ir led offset from the screen, to make it 100% accurate.
If this is needed i do not know, as im currently waiting for a package of 100 940nm leds from china.
For those interested in the link:
https://www.aliexpress.com/item/32755919314.html?spm=a2g0s.9042311.0.0.21694c4dLn44LN (https://www.aliexpress.com/item/32755919314.html?spm=a2g0s.9042311.0.0.21694c4dLn44LN)
As for the gun itself, i didnt use the DFRobot IR positioning camera.
But rather the IR camera from a wiimote, which i found out you can actually take out of the metal/plastic housing, so you dont even need to desolder it from the wiimote, just pry it out of the holder, and you have 8 solderpads on the rear.
(I will provide pics for the next gun, i'm planning to build)
The reason for taking that route is that i thought that the DFRobot camera was pretty pricey, and i actually had a wiimote at my disposal.
The rest of the components was/is accessible free of charge at the local hackerspace in which i'm a member. (except for a 3.3v switchmode regulator that cost about 0.43$ incl. shipping)
If anyone is interested in going that route i could whip up a pcb in kicad and the components as a kit for a modest price (most certainly not the reason for making this post!)
I guess most of you have seen the old wiimote arduino guides?
Well they do level conversion of the i2c signal which is overly complicated and completely unnecessary!
I just powered the camera through the previously mentioned 3.3v regulator, pulled the SDA and SCL lines to that 3.3v through 2.7k resistors.
The 5V atmega32u4 reads those 3.3v i2c signals just fine.
Other than that its just a 20MHz crystal, 2 capacitors and a 33k (or lower) resistor to hold the reset pin on the camera HIGH.
@JayBee, i know it seems like a good idea to only release the hex file, though if you'd be willing to i'd very much like to have the sketch provided, i will ofcourse contribute if i come up with something good :D
I will most certainly do that! i would take pictures of what i have made, but it wouldnt be much use as i have hot-snotted everything together.Ah yes, finding good IR LEDs for this kind of project is really a pain. Currently working with powerful LEDs but that have terrible viewing angle, and still waiting for the 120° LEDs I ordered from China 2 weeks ago, to see how they will perform (will post them in the first post if they work well.
yeah, the DFRobot camera, is as far as im aware the exact same camera, but with the supporting components attached in a neat shell.
I totally get it! and im looking forward to testing it... but alas i have to either source the ir leds locally or wait that month or so for the ones from china.
but its okay, as i will then have time to get hands on another gun... or maybe make one from scratch in lasercut wood.
Congratulations JayBee, great work :applaud:Thanks :)
Will you update the source code at GitHub later on, or is the project closed source now?
I think I already told you, jolt gun delivery fees to Japan are >50$, and for the last time, I am not interested in buying those, I am very happy with my current guns, thanks.It's more like saying "regardless if you plan to use the car once per month or every day, you should get one with brakes that work". And, "if you can't afford a car with working brakes, it's better to get nothing at all".The jolt gun I found + sending fees was more than 100$ in total.
I don't live in Japan or know the market there but I don't believe that it's not possible to buy a continuous duty solenoid. Especially as some of the solenoid brands I've seen are Japanese companies. Plus, there is a bunch of low cost arcade parts sellers that are based in Asia and ship internationally. And, there are plenty of ebay sellers who ship internationally. I order stuff from Japanese sellers all the time. I'm sure that if you kept an eye on ebay, you'll find a jolt gun from a seller who'll ship to Japan.
Also, Namco, a Japanese company, sell new Time Crisis 4 gun shells and recoil solenoids for $120 in America. I'm sure they will have a parts distributor for their home market and that it wouldn't be significantly more expensive which means, if you know where to look, there will be used parts selling for less.
Arcade parts here are actually more expensive and hard to come by than outside of Japan, thanks to the high demand of arcade centers that are everywhere here, that would pay any price to get their parts.
Plus none of those gun part shop is open to the public, only people with an arcade company can order. They are protective of their market and tech.
So getting official part would be very expensive for me AND extremely troublesome.
But if you can show me some model of continius duty solenoid you think are good and than can fit in my guns, I will gladly take a look at it.
It sucks to be in Japan (for light gun fans)....
You should be able to find one cheaper than that though. I can order a jolt gun right now off ebay for $35 delivered. For you, it's probably best to search for UK sellers. These guys will send me this PS1 recoil gun from the UK for less than $30 delivered:
https://www.ebay.com/itm/Playstation-2-SATURN-SILVER-AVENGER-PRO-LIGHT-GUN-CONTROLLER-PS2/333345578110?hash=item4d9cf1dc7e:g:120AAOSwnD1dkejz
There is usually a lot of jolt guns there. If you put an offer in for ones like this, I'm sure they'll take it:
https://www.ebay.com/itm/Pistola-Gun-per-Playstation-1-PS1-e-Sega-Saturn-con-pedale-Funzionante/303335038088?hash=item46a02d5c88:g:MKcAAOSw~KpcduNN
In terms of solenoid models, just add the word "continuous" to an ebay search for pull solenoid, or check the specs for Duty cycle: Continuous.
Can you show me any push-pull solenoid that is actually continuous duty? I don't believe that even exists, for a simple technical reason; solenoid ALWAYS heat when staying activated, no matter the power/type/size.
Oh I see! My bad, I guess I didn't search well enough ::)
That's why I gave you a link to someone selling one with cheap international shipping. Just because you looked once and found one that was expensive, it doesn't mean they all are. But I get it, you can't afford one. No matter what the price.
On the continuous duty solenoid, as I said, search eBay for "pull solenoid continuous" and you'll see there are lots of options:
https://www.ebay.com/sch/i.html?_from=R40&_trksid=m570.l1313&_nkw=Pull+solenoid+continuous&_sacat=0&LH_TitleDesc=0&_osacat=0&_odkw=Guncon
Or don't. Whatever.
I don't have a dog in this fight, but I'm with Zebra on this one.... you can find cheap parts anywhere... in some areas of the globe it might take a lot of effort to do so, but Japan.... nah.If you know any shop (local or online) that sell this kind of part in Japan, I am very curious to know ;)
I'm sure there are large arcades with machines that are owned by the brand but that won't be the case with a lot of smaller arcades running older games that Namco and Sega etc no longer support.That's a lot of info, thanks! :D
These old arcade cabs are getting thrown in dumpsters in Japan, just like they are here in the States and in Europe. Seeing stuff like this breaks my heart:
https://www.youtube.com/watch?v=SS9-T-KgmmM&t=1s
https://www.youtube.com/watch?v=Gmhc0i9co-s
They don't even attempt to find a home for all those candy cabs that we sell our kidneys to get here. The solenoids in those gun survivor 2 guns they were throwing away are excellent BTW.
They used to maintain a list of Japanese arcade PCB stores over on the shmups forum which shows there are plenty of places for consumers to buy old arcade parts there. My ability to search them was always limited by my lack of Japanese language skills though.
As a general point, all those 3rd party ps1 and PS2 recoil guns were made in Asia. A lot of the ones here were originally ordered online from stores in Hong Kong like Play Asia. I am positive that the same stores we buy from in HK and mainland China would also have shipped to Japan. I wouldn't assume there are none to be found locally.
People travel to Japan from all over the world to buy video games and peripherals. We think of it as a video game Mecca. You guys have lots of stuff we've never even seen (like the original Famicom recoil machine gun). I'd keep an eye on local video game stores who sell older used consoles.
Also, Suzo Happ, one of the two large arcade parts suppliers here, have a store in Hong Kong to support customers across Asia. There is also another store in HK called Happ that sells arcade parts but they have nothing to do with each other.
These guys (also in HK) can often get used arcade parts. Ask them if they can track you down a cheap Time Crisis solenoid replacement. The Chinese knock-off Time Crisis guns are usually a lot cheaper and have a stronger solenoid.
https://www.arcadespareparts.com/arcade_parts/shooting_parts.html
Solenoid specs like voltage and amps won't help. Most arcade solenoids use 12v or 24v PSUs but so do a bunch of momentary solenoids that are not suitable for continuous duty. I would use the largest continuous duty tubular solenoid you can fit in your shell. The power supply only matters in terms of matching it to the specific solenoids ratings.
There is no copyright laws protecting light guns or solenoids. A lot of arcade light gun cabs have the guns replaced with Happ or Betson light guns as the tech is generic. Any decent arcade owner would be capable of switching out the light guns to replace old expensive oem guns with new generic ones.I know those shops very well, I've been to each of them many times. Out of the shop your search shows, only one (BEEP) actually sells some arcade part (but very few), and of course no lightgun parts. They are all consumer retrogame shops, not arcade part shop (which are two different things).
I am no expert on Japanese law but I would be very surprised if there was any law that prevented arcade owners selling old cabs and parts they no longer use to whoever they like.
There is also no reason why manufacturers would be protective of gun hardware but not their PCBs. I think you've been misinformed. If an arcade owner sells or breaks a pcb, they will part out the rest of the cab and sell parts to whoever. It's always been that way, even when arcades were at their peak in the 80's and 90's.
If I put a search in Google, in English, for "used arcade parts Tokyo Japan", I get multiple results for stores selling used arcade parts....
https://www.google.com/search?q=used%20arcade%20parts%20tokyo%20japan&rlz=1C1SQJL_enUS844US844&oq=used+arcade+parts+tokyo+japan&aqs=chrome..69i57.11966j0j7&sourceid=chrome&ie=UTF-8&safe=off&npsic=0&rflfq=1&rlha=0&rllag=35700934,139771333,185&tbm=lcl&rldimm=1791196374969552662&phdesc=8DEOZzsG28M&ved=2ahUKEwi457fwqMXlAhUFj1kKHR6ZDUIQvS4wAnoECAoQOQ&rldoc=1&tbs=lrf:!2m1!1e2!2m1!1e3!3sIAE,lf:1,lf_ui:10&rlst=f#rlfi=hd:;si:7617596130752392823,y,pC1rO5bV5SY;mv:[[35.713045099999995,139.776682],[35.5164013,139.68927209999998]]
The existence of stores just shows that a consumer arcade market exists and that there is somewhere for those stores to buy parts for the cabs they refurbish. I.e. it’s not an impossible quest.Not saying this market doesn't exist, far from it. Just saying that for different reasons they don't sell lightguns.
A lot of the old arcade companies aren’t even in business anymore or no longer make arcade games so they won’t be supporting their products, or any other. Owners of retro arcades must have somewhere to buy replacement parts and trade with each other. You are better placed to find it than me. There are plenty of arcades closing down in Japan too. I’d want to find out where all those cabs go to die and maybe make a trip to one of those arcade graveyards. Old Time Crisis cabs don’t evaporate and most are no longer in arcades, so they must be somewhere.
These are old products now from the crt era. I’m not sure I could find a retail store that sells light guns here either. When I want stuff like that, I search the internet, regularly check eBay for a deal and put wanted ads on Craigslist and sites like this. It sometimes takes a while but I usually find what I’m looking for eventually. It’s a global world and a global internet. Most of the resources available to me are available to you too.
Solenoids and light gun shells are small enough to ship at affordable prices from most countries. You’ll find one eventually. Did you look at that avenger pro recoil gun I sent you the link for? I haven’t used that particular model myself so I don’t know if the recoil mechanism uses a motor or solenoid but it looks the part in this video and is cheap enough to take a chance on maybe:
https://www.youtube.com/watch?v=vv_rQOI84Q8
Sooooo.... after doing a tiny bit of research... i found out that the nintendo Switch has got a pretty sweet ir camera.Dude that's very interesting research you are doing there :lol
It apparently outputs an actual image through SPI. and not i2c as the wiimote does.
https://www.techinsights.com/blog/nintendo-switch-teardown (https://www.techinsights.com/blog/nintendo-switch-teardown)
The reason i got entrigued, was the fact that you can buy the camera seperately for about half the price of the DFRobot cam.
https://www.aliexpress.com/item/32933494037.html (https://www.aliexpress.com/item/32933494037.html)
Surely i dont have the skill to program something to actually process the image data,
but i was thinking that you'd probably be able to track the heat of the screen itself.
Another way you could probably make some sweet lightguns would be from the switch joycon itself.
using Joy-con toolkit https://gbatemp.net/threads/tool-joy-con-toolkit.478560/ (https://gbatemp.net/threads/tool-joy-con-toolkit.478560/)
This could make it possible to have them running via bluetooth. I am aware that the wiimote does aswell,
though it certainly is larger.
BTW im not trying to make a point or anything, just sharing what i found interesting.
Also, i just bought another Konami hyper blaster in darkblue, so i have 2 for my homebuilt arcade. which i will design a pcb to mount the wiimote camera, will probably share it on github when im done.
This will be a replacement for the DFRobot camera as mentioned before.
Wait, you're telling me the Wiimote sensor can also be used with serial (SDA&SCL), and keeps track of the IR Points? I though it was only the DFRobot cam that had some extra components on their PCB for that :lol
Thanks :cheers:
I dont have any clue, didnt go that deep into it, but my main idea from it was just track the hot square that is the monitor.
Ofcourse! and there's nothing wrong with that! :D
But if the wiimote cam is indeed the same. why not make it cheaper... for me its necessary as my wallet is pretty much empty atm...
Aaaaand i wanted to learn how to design a PCB as i actually have a crapton of requests for PCB and mechatronics designs.
I did design the board tonight, and will probably release it on github on tuesday, as i have to get my design checked at the hackerspace :D
Stay Tuned!
The IR functionality is nearly identical to the wiimote because they included it for backwards compatibility. As for some of the IR heat detection functionality they've been using it for, I think that's fairly short range. Also lcd/led tvs don't put off a great amount of heat so I doubt they'd show up anyway.Backwards compatibility, on the switch? Did I miss some info on that? ???
Wait, you're telling me the Wiimote sensor can also be used with serial (SDA&SCL), and keeps track of the IR Points? I though it was only the DFRobot cam that had some extra components on their PCB for that :lol
It's interesting for me too since I do have some broken wiimote motherboards around, I could use them to do some extra stuff.
I also wonder how much it would cost to do a custom PCB for the wiimote sensor?
You didn't miss anything. You know where they have been porting a bunch of wii u stuff over to the switch? The wii u supports wiimotes just like the wii did. Thus far they haven't ported anything that requires a wiimote ir sensor, but you know Nintendo.... they cram as many sensors in as possible just in case.Yeah but the architecture of the switch, along with all the hardware, including controllers, is massively different. I've been working on one of the first big N "ports" of the switch for while, and the dev team had to pretty much rewrite all the engine to make it run on it.
Thats exactly what I'm telling you 8-)That's really cool dude! Would you have a kind of schematics for that? Would love to test it :D
The only needed components to get the wiimote camera to talk to the arduino is as follows:
A 3.3V regulator for the I2c pullup aswell as the Power.
A 20 to 25 MHz crystal oscillator (resonator wont do) for the camera clock
2 2.7k resistors
A 30 or 33k resistor to pull the camera #reset pin high
2 10nF capacitors for the crystal, which might not even be necessary
a 100uF capacitor for the 3.3v regulator
And a 4 pin connector if you dont fancy wires soldered directly to the pcb.
When my pcb design is confirmed to be correctly made i will order a bunch as you can get 5 50x50mm pcb's for 5$
In china however, they're smaller than that so by panelizing them i might be able to fit 3 or 4 boards within those 50x50mm.
So i will sell the ones i dont need for almost nothing if you're interested.
Also from judging the spec Sheet of the robot cam https://www.robotshop.com/en/ir-tracking-camera.html (https://www.robotshop.com/en/ir-tracking-camera.html)
And what people have found the wiimote camera to be, its pretty darn close.
http://www.robotreviews.com/chat/viewtopic.php?t=8255 (http://www.robotreviews.com/chat/viewtopic.php?t=8255)
keep in mind that some of them measure viewing angle from center to edge, whilst others do it from edge to edge.
That's really cool dude! Would you have a kind of schematics for that? Would love to test it :D
But you still have to analyse the signal, or it is sending you raw coordinates?
The thing with the DFRobot cam is that it's pretty much sending you the coordinates of the 4 detected IR point through serial, and it follows those points as long as they stay on range.
So for the sketches, it reduces greatly the arduino load and the sketch size, and in result reduces the latency.
For the sensor specs, on DFRobot website they basically link to the wii sensor wiki page, so I wouldn't be surprise if they are using the actual Wiimote sensor in it :lol
Just in case, would you happen to know a bit about the Playstation 2 USB protocol? Since the sketch is quite stable now, I'm trying to add support to that :P
Awesome, can't wait to see your schematic ;)
:banghead: hit reset after writing a long reply...
But I did make a schematic which I will provide when I get back from my gf in a couple of days.
As for the camera it talks the same language as the robot camera.
I know cause I used your 2 point sketch, with minor changes as I couldn't get axis reverse to work properly, so I changed the for loop to have #ifdef instead of if statements, which should run faster and compile smaller.
I also changed a couple of the constant integers into #define.
But that doesn't interfere with the dfrobot library protocol.
As for the camera being the same didn't really surprise me during research.
The camera is apparently either developed and maybe made by a company called pixart, but it seems to be a pretty secretive company.
About the ps2 usb protocol I haven't got any clue.. But the documentation of the Linux ps2 devkit might be of use.?
If the DF robot can really is the exact same part as found in a Wii remote then I wonder why Nintendo chose to only use one sensor bar with just one point of reference. The DF Robot cam states it can track 4.I guess they wanted to keep it simple for everyone to use, even everyone's grandma, while keeping it low cost for them? :lol
I guess the obvious answer is that they didn't intend to design it to be a light gun.
Is the PS2 USB protocol the sort of thing you can get from the EMS Topgun 3 drivers with it being another IR gun that works on the PS2 as a Guncon 2?Oh yes I will try contacting the guy who did the wingun driver, he will probably have a good idea on how things work ;D
Also, the guy that wrote the Wingun drivers is a member here. Perhaps he has some insight into how the Guncon 2 hardware works.
One other place to look is the file labeled USB gun on PS2 guncon 2 game discs. I don't understand the code but my assumption is that this is the guncon 2 drivers that the PS2 uses.
Not really an answer to all of the above.. (quoting is hard on the phone)Yeah was thinking about that too, but decoding this communication protocol seems to be such a pain :lol
BUT JUST GOT AN AWESOME IDEA!
What if we were to use the nunchuck for extra buttons for those controller which dont have a d-pad and such.
Got the idea from watching metal Jesus play with the gcon 2.
I think it would be possible to use the plug from the wiimote by desoldering it and making a custom pcb with ordinary pimheaders to attach to the pro-Micro... Or stm32 if i can get i2c working on it :-D
Not really an answer to all of the above.. (quoting is hard on the phone)Yeah was thinking about that too, but decoding this communication protocol seems to be such a pain :lol
BUT JUST GOT AN AWESOME IDEA!
What if we were to use the nunchuck for extra buttons for those controller which dont have a d-pad and such.
Got the idea from watching metal Jesus play with the gcon 2.
I think it would be possible to use the plug from the wiimote by desoldering it and making a custom pcb with ordinary pimheaders to attach to the pro-Micro... Or stm32 if i can get i2c working on it :-D
And to be honest there aren't many games that support guns with dpad and all.
The most convenient thing about it is being to scroll games menu with it.
I guess we could also bypass the nunchuck board entirely and connect the buttons directly to the cable, but we would then need a way to read the joystick 2 axises too.
Well was gonna say that I would take a nunchuck apart. But then i found this https://create.arduino.cc/projecthub/infusion/using-a-wii-nunchuk-with-arduino-597254 (https://create.arduino.cc/projecthub/infusion/using-a-wii-nunchuk-with-arduino-597254)Wow that guys already did all the hard work, with that we can actually do it easily. I have an old after market nunchuck somewhere, I will give it a try when I have more time.
So it speaks i2c at 3.3v just as the camera, which means that it can actually share the i/o pins as they have different adresses.
Which is probably how the wiimote talks to it.
So it'd be super easy to implement :-D
Edit: btw reading 2 joystick axes (axis in plural ;-)) is super easy, just do 2 analog reads, as they are almost always constructed as potentiometers :-)
What I did a while ago was to use an extra atmega Arduino I had (I buy them in pack), and put it inside an old arcade stick, to simulate a bunch of keyboard keys, which work in pretty much any app/emulator.Not really an answer to all of the above.. (quoting is hard on the phone)Yeah was thinking about that too, but decoding this communication protocol seems to be such a pain :lol
BUT JUST GOT AN AWESOME IDEA!
What if we were to use the nunchuck for extra buttons for those controller which dont have a d-pad and such.
Got the idea from watching metal Jesus play with the gcon 2.
I think it would be possible to use the plug from the wiimote by desoldering it and making a custom pcb with ordinary pimheaders to attach to the pro-Micro... Or stm32 if i can get i2c working on it :-D
And to be honest there aren't many games that support guns with dpad and all.
The most convenient thing about it is being to scroll games menu with it.
I guess we could also bypass the nunchuck board entirely and connect the buttons directly to the cable, but we would then need a way to read the joystick 2 axises too.
That's what I thought when I made my Time Crisis arcade guns into Guncon 2's but it was a big mistake. It's true that only a few guncon 2 games use the D-pad but a good number use it to navigate through the options menu. It was really annoying to have to keep unplugging the gcon to switch between Virtua Cop 1 and 2 on the Elite edition disc and I couldn't even access the menu system on Guncom 2.
I put all my recoil hardware and the guncon 2 PCB in a wooden box. I ended up adding all the guncon buttons (beside the trigger) to the box and I put a joystick on the other side. My pedal also attached to the box. I suggest you do the same. You need every guncon 2 button and the d-pad unless you only want to play the Time Crisis games.
Also, while you're looking at how to make the gun work on the PS2, there is a good number of rail shooters on the PS2 that currently have no gun support at all. They only allow you to use the analog stick. I am working on hooking up my positional arcade guns but you might be able to add an analog stick mode to your gun to make it work on games like Silent Scope, Combat Queen, Ghost Vibration and Operation Wolf (on the Taito legends disc).
JayBee, Can you add analog input feature on firmware? 2 axis are ok.This kind of fixed gun tech has nothing to do with the IR cam tech we are using here, it would require a totally different firmware.
I have fixed analog arcade gun. I use it playing Let's go island, Terminator 2 arcade... etc.
(https://ae01.alicdn.com/kf/HTB1uA64dA9WBuNjSspeq6yz5VXaH.jpg)
It has two potentiometer, x-axis and y-axis. No pcb inside.
If analog inputs are supported, I can play both rail-shooter game which support analog gun and only support mouse input.
And that gun has built in solenoid, your firmware has solenoid automatic recoil output, that make easy to setup. How great.
That's what I thought when I made my Time Crisis arcade guns into Guncon 2's but it was a big mistake. It's true that only a few guncon 2 games use the D-pad but a good number use it to navigate through the options menu. It was really annoying to have to keep unplugging the gcon to switch between Virtua Cop 1 and 2 on the Elite edition disc and I couldn't even access the menu system on Guncom 2.
I put all my recoil hardware and the guncon 2 PCB in a wooden box. I ended up adding all the guncon buttons (beside the trigger) to the box and I put a joystick on the other side. My pedal also attached to the box. I suggest you do the same. You need every guncon 2 button and the d-pad unless you only want to play the Time Crisis games.
Also, while you're looking at how to make the gun work on the PS2, there is a good number of rail shooters on the PS2 that currently have no gun support at all. They only allow you to use the analog stick. I am working on hooking up my positional arcade guns but you might be able to add an analog stick mode to your gun to make it work on games like Silent Scope, Combat Queen, Ghost Vibration and Operation Wolf (on the Taito legends disc).
Wow that guys already did all the hard work, with that we can actually do it easily. I have an old after market nunchuck somewhere, I will give it a try when I have more time.My electronic knowlegde is pretty low... but i do spend a lot of time at the local hacker/makerspace, where i learn a lot from other makers.
You look like you know way more than me in electronic, would you like if I share the 4 leds sketch and schematics with you in private? I would really use some help on making it better, especially on the electronic side of things 😅
Well i think seeing as it would be so easy to implement it and totally omittable during the specific build.If you're talking about the joystick support, it's already fully supported in my firmware (the joystick mode I'm talking about in my post ;) ). But of course it will only work with games that use absolute joystick motion (one stick position = one position on screen), sadly there is no way to get a precise aiming with games that use relative motion (moving the cursor by holding one direction) due to the way they work.
We might aswell add the feature.
Now, you are totally right about the small number of titles supporting it. But the more it supports the better IMHO.
My electronic knowlegde is pretty low... but i do spend a lot of time at the local hacker/makerspace, where i learn a lot from other makers.Doesn't look that bad to me, but might be because I am terrible at it :lol
However, yes i'd like that.
I put the schematic up on github, so feel free to update it with your ideas. I scaled the pcb as such that it should fit 4 boards within 50x50mm to make them super cheap to order.
There's only 2 things i think it could use is pads for different sized crystal oscillators and 4 more pins to pass the i2c bus for the nunchuck and whatever we may want to add in the future.
https://github.com/Mysli0210/Liightgun (https://github.com/Mysli0210/Liightgun)
If you're talking about the joystick support, it's already fully supported in my firmware (the joystick mode I'm talking about in my post ;) ). But of course it will only work with games that use absolute joystick motion (one stick position = one position on screen), sadly there is no way to get a precise aiming with games that use relative motion (moving the cursor by holding one direction) due to the way they work.Not talking about the joystick mode, but rather making the joystick on the nunchuck, act as if were a d-pad like on the G-con2.
Doesn't look that bad to me, but might be because I am terrible at it :lolIt could be added, but again i tried to keep it very small to make it super cheap to get made. but i could do a pcb for those functions.
I was wondering if it would be a good idea to merge your pcb with my solenoid/rumble circuit, and add GND soldering points for the buttons (the few GND on the arduino board aren't enough), it would make a great all in one solution :D
Not talking about the joystick mode, but rather making the joystick on the nunchuck, act as if were a d-pad like on the G-con2.Ah yes, you're right, it seems fairly easy to connect the nunchuck with the i2c connection. We can even find some arduino libraries online. I will definitely try it when I have a bit more time.
A few of the titles support it, but watch this instead to see what i mean https://youtu.be/dOSRxiLEVmI?t=226 (https://youtu.be/dOSRxiLEVmI?t=226)
It could be added, but again i tried to keep it very small to make it super cheap to get made. but i could do a pcb for those functions.Having small pcbs instead of one big is actually what I am doing in my guns, but despite being perfectly functional it looks very messy :lol
I made the schematic for the board to hold the nunchuck connector, which in itself will be pretty small and only have an internal connector (optional), the nunchuck connector, 2 pullup resistors, a regulator and a cap.
Its not that i dislike your idea, but i think its better to have a few small pcb's rather than one big, seeing as it will then be easier to adapt to the specific gun.
Regarding the ground connections, you can scrape off some of the soldermask, both sides are grounded decently.
but a much more sane approach is daisychaining the ground from button to button. my konami gun was even wired that way from the factory.
JayBee, Can you add analog input feature on firmware? 2 axis are ok.
I have fixed analog arcade gun. I use it playing Let's go island, Terminator 2 arcade... etc.
(https://ae01.alicdn.com/kf/HTB1uA64dA9WBuNjSspeq6yz5VXaH.jpg)
It has two potentiometer, x-axis and y-axis. No pcb inside.
If analog inputs are supported, I can play both rail-shooter game which support analog gun and only support mouse input.
And that gun has built in solenoid, your firmware has solenoid automatic recoil output, that make easy to setup. How great.
JayBee, Can you add analog input feature on firmware? 2 axis are ok.This kind of fixed gun tech has nothing to do with the IR cam tech we are using here, it would require a totally different firmware.
I have fixed analog arcade gun. I use it playing Let's go island, Terminator 2 arcade... etc.
(https://ae01.alicdn.com/kf/HTB1uA64dA9WBuNjSspeq6yz5VXaH.jpg)
It has two potentiometer, x-axis and y-axis. No pcb inside.
If analog inputs are supported, I can play both rail-shooter game which support analog gun and only support mouse input.
And that gun has built in solenoid, your firmware has solenoid automatic recoil output, that make easy to setup. How great.
Ah yes, you're right, it seems fairly easy to connect the nunchuck with the i2c connection. We can even find some arduino libraries online. I will definitely try it when I have a bit more time.
Having small pcbs instead of one big is actually what I am doing in my guns, but despite being perfectly functional it looks very messy :lol
But I guess there is no way around it if we want to fit it in any gun model.
Daisy chaining is good, but when each point needs to be soldered somewhere (beside the GCon2 I completely replaced the guns original pcb, and they aren't arcade guns, just cheap PS2/Saturn guns), every time I have to add a ground (button or other) it gets complicated. I preferred making a small board where each ground is attached, even if it's a bit dirty.
I will send you the schematics too once I make them clean. What software are you using for your schematics?
I'm not saying that's impossible, I'm just saying my setup isn't compatible with it nor will be, that's not the purpose of it at all.This kind of fixed gun tech has nothing to do with the IR cam tech we are using here, it would require a totally different firmware.
That's not 100% accurate. Most arcade IR gun I/O boards output as regular analog joysticks. In most cases you can use a positional gun instead of an IR gun with the same arcade PCB. The I/O boards just translate the positional data to the same 0-5v signal you would have got from a pot for the X and Y axis. The is a video on Youtube of some guy using a Taito positional gun in place of the IR gun on that Rambo arcade game.
I used KiCad to design the schematics.None of the buttons in my guns have 4 leads, they aren't arcade guns.
yeah they need to be soldered somewhere, but most buttons do have 4 leads that are interconnected in pairs.
I really dont see how having a lot of ground wires going to one pcb and then to the arduino is less messy nor easier to deal with :)
(You should see the wiring of the joycons of my homebuilt arcade ::))
But if its such a hassle for you, i would suggest using enamel wire (the type where you can melt the insulation) to just use one wire that is soldered to each button.
We could do something entirely else though.
To make a pcb for each guntype, which would be way more expensive, though super easy to install.
None of the buttons in my guns have 4 leads, they aren't arcade guns.
My solution is sure not the best recommend one, but I did it to avoid touching the button boards and wires too much (I have no replacement if I damage them) or messing up with the button themselves. If I chain solder them and one point in the chain breaks or do wrong contact, it will be such a pain to troubleshoot.
I also have grounds for other things than buttons, like solenoid and rumble.
You can see pics of the inside of my guns to understand what I mean:
http://forum.arcadecontrols.com/index.php/topic,161192.0.html
They changed a lot since I took those pics, but you get the global idea.
Yeah we could do a different pcb for each, but like you said, it would be expensive, and not sure if it's worth it ;)
I'm not saying that's impossible, I'm just saying my setup isn't compatible with it nor will be, that's not the purpose of it at all.This kind of fixed gun tech has nothing to do with the IR cam tech we are using here, it would require a totally different firmware.
That's not 100% accurate. Most arcade IR gun I/O boards output as regular analog joysticks. In most cases you can use a positional gun instead of an IR gun with the same arcade PCB. The I/O boards just translate the positional data to the same 0-5v signal you would have got from a pot for the X and Y axis. The is a video on Youtube of some guy using a Taito positional gun in place of the IR gun on that Rambo arcade game.
It would require to do a special version that pretty much remove 90% or my code (IR detection and all), and change the rest significantly. So a brand new sketch...
And before you ask, no it's not possible to add it to this sketch, because 1. All the analog pins are already in use for something else and 2. The sketch is already taking more than 80% of the Arduino flash, and I want to add more functions in the future. ;)
Edit: By the way don't mix input and output. My sketch always had a joystick output, since the very first version :lol
But it doesn't support joystick input that bypass the IR detection.
However anyone who want to have a special version for that is free to use my 2 IR points sketch, which should work fine after removing the IR detection code.
Well i cant really see whats going on behind that hot-snot glue (which you can remove with rubbing alcohol, if need be ;))Yeah despite what many people say, hot glue is so convenient when you don't have 3D printer or anything like that. Easy to put, easy to remove, and hold things very well.
But the microswitch (the one you call arcade) is super easy to solder several wires onto, as it has got a hole in the lead which you can hook the end of the wire around before soldering... heck even after if you heat the solder up before.
BTW they are easily obtained, they go by the name 1c25, there are other types such as DB1, DB2 & DB3 but they have a different size, just if need be :D
and the pcb with the red button(s)? should be pretty easy to wire up with a common ground wire aswell.
Here's a couple of pics of my gun, which surely could use some tidying up.
https://drive.google.com/open?id=1-2D4oAQEHhFUM4F9ROmfW6oOpiYpz_iA (https://drive.google.com/open?id=1-2D4oAQEHhFUM4F9ROmfW6oOpiYpz_iA)
Though there are 2 wires connected on one pin of the trigger pcb, the rest are daisychained from there. Just as it was from the factory.
Also should you need spare pcb's, provide me with a drawing with measurements and holesizes.
and i'll design a new one for ya ;)
I could even make one that extends rearward which can hold the arduino, mosfet and all the supporting components.
You wouldnt happen to have a scanner and a ruler would you?
Cause if you lay the gun, or even guns on their (in)side next to the ruler and send me the picture i'll design it to work for that gun.
You'd ofcourse have to make sure that it is clean against the glass, so that there's no warping or out of focus places.
and i'll make it so you have several through-holes where you can attach the ground wires :D
EDIT:
@JayBee, if you wanted to have me take a look at your code, make a user on github and make a private repository for it and share it with me :D
EDIT2:
I dont think you should have the camera board act as the ground for the solenoid as that could actually deprive the camera of power on activation (read. inrush current)
what you'd ought to have is a beefy capacitor, maybe even a super capacitor to conserve space right next to the mosfet.
I'll throw some cents in here:
Mice in windows can be setup two ways. Either as a relative position device, which works as you think it does (x number of ticks in a given direction) or absolute position... which I believe gives the x/y position in a 0 to 1024 value in both x and y. Imho neither of these should be used as output to make a modern light gun. Why? Well windows handles mouse input surprisingly poorly. One mouse read in relative position does just fine but absolute position or multiple mice aren't universally supported in games. As a matter of fact, the reason troubleshooter, troubleshooter 2 and demulshooter exist is due to the poor mice support in the typical gun game released on the pc... even some emulators. This is due to the fact that the various apis used to interface with multiple mice are outdated and/or cumbersome.
On the other hand if your gun shows up as a joystick you are golden. Most modern games can handle two gamepads just fine and as a quick kludge to support older games, it's pretty easy to use middle ware to move the mouse cursor with a joystick. Multiple mice aren't officially supported in any commercially available games due to the api issues, so going forward, any gun games released on the pc are probably going to have gamepad support, with developers assuming you'll actually use a gamepad since true pc guns are dead atm. That's just fine if you make a new light gun show up as a joystick, but it means more hacking if you have it show up as a mouse.
That explains why arcade developers almost always choose to have the gun I/O board output as an analog joystick, regardless of the gun tech. Modern arcades are PC's under the hood so they probably have to deal with all the same challenges
Also, if the plan is to make a gun work with older consoles on HD flat screens, most light gun games already have analog joystick support. A few of the PS2 rail shooters I have tried even offer a choice of relative or absolute positioning (they call it "regular" and "pro" mode). I am relying on this to add light gun support to the few PS2 rail shooters with no gun support once my Sega arcade IR gun is set up.
House of the Dead 4 on the PS3 even offers calibration and an option to turn off visible crosshairs when played with an analog joystick. I have high hopes for using my HOD4 arcade gun with it (with the I/O wired to a PS3 six axis pad).
Do you have any insight on which mouse mode the Aimtrak uses when set to work as a mouse? It kinds seems like it works in relative mode as it doesn't seem to have the capability of recording accurate coordinates.
JayBee, Can you add analog input feature on firmware? 2 axis are ok.This kind of fixed gun tech has nothing to do with the IR cam tech we are using here, it would require a totally different firmware.
I have fixed analog arcade gun. I use it playing Let's go island, Terminator 2 arcade... etc.
(https://ae01.alicdn.com/kf/HTB1uA64dA9WBuNjSspeq6yz5VXaH.jpg)
It has two potentiometer, x-axis and y-axis. No pcb inside.
If analog inputs are supported, I can play both rail-shooter game which support analog gun and only support mouse input.
And that gun has built in solenoid, your firmware has solenoid automatic recoil output, that make easy to setup. How great.
That's not 100% accurate. Most arcade IR gun I/O boards output as regular analog joysticks. In most cases you can use a positional gun instead of an IR gun with the same arcade PCB. The I/O boards just translate the positional data to the same 0-5v signal you would have got from a pot for the X and Y axis. The is a video on Youtube of some guy using a Taito positional gun in place of the IR gun on that Rambo arcade game.
We weren't talking about your firmware (I've never seen it). I was asking about how Aimtraks work in mouse mode.Yes we were. Where did we speak about the aimtrak?
On the light gun, maybe you could add a small solenoid inside the grip for semi auto recoil (like Happ recoil guns) and then just use the motor for full auto. Unlike full auto, you can use any solenoid for semi.
I actually prefer motors over solenoids for full auto only games but, it depends on the mechanism. With a decent motor and a brass knocker mechanism you can get a much better full auto effect. The recoil mechanism in the Konami Teraburst rifles is the best I have seen:
(https://i.postimg.cc/3WWDPWYG/IMG-4492.jpg) (https://postimg.cc/3WWDPWYG)
If you are handy and creative, adding a brass knocker and maybe a motor upgrade is not too difficult. It's the noise of metal hitting metal that really sells it.
Well how I'm going to build mine (assuming I ever get around to it) is to put all the electronics in a square tube with all the I/o connecting up vid a d-sub on the tube. For handgun games I'll build a hand gun shell with a solenoid and for full auto I'll have a machine gun shell with a motor. I think the wiimote method of different shells would help a lot in regards of trying to get one system to do it all. That or build a second set of guns.Sounds good, would love to see what you build.
Well how I'm going to build mine (assuming I ever get around to it) is to put all the electronics in a square tube with all the I/o connecting up vid a d-sub on the tube. For handgun games I'll build a hand gun shell with a solenoid and for full auto I'll have a machine gun shell with a motor. I think the wiimote method of different shells would help a lot in regards of trying to get one system to do it all. That or build a second set of guns.
I’ve been looking for some good leds for this project. It’s hard to find wide angle ones in the uk.
Does anyone know if these would be good?
They aren’t the same wavelength as recommended but I think the camera supports it.
https://rover.ebay.com/rover/0/0/0?mpre=https%3A%2F%2Fwww.ebay.co.uk%2Fulk%2Fitm%2F264301195521
Not sure if this helps but, on the Sega Type 2 /Namco arcade IR guns, the led boards are designed to allow users to bend individual LEDs to face the desired direction to deal with any issues related detection angles. You often see Led boards from games with larger screens with the corner LEDs bent to face inwards.
The Guncon 3 also has LEDs facing different directions so maybe this is a better way of dealing with detection angle issues than trying to source "wide angle LEDs".
The Extreme IR bar sold by ArcadeGuns claims to have wider angle LEDs that let users play at more extreme angles or closer to the screen. One of the guys on this forum bought one and reported that it made no difference. Perhaps "wide angle LEDs" is just marketing bullsh*t....
Most people play light gun games in front of the screen anyway. It's probably best to just use any LEDs that work to get it up and running. Nobody is going to be able to tell you which LEDs work best for this as it's all new.
Have you tried with putting something infront of the led that makes it more wide-angle? like maybe just a thin sheet of paper or similar?That's a good suggestion, I might try to see how it will react with a kind of half sphere filter.
the wii remote sensor bar and my ems topgun sensor bars seem to have pretty uniform brightness, mostly independent of viewing angle.
Have you tried with putting something infront of the led that makes it more wide-angle? like maybe just a thin sheet of paper or similar?That's a good suggestion, I might try to see how it will react with a kind of half sphere filter.
the wii remote sensor bar and my ems topgun sensor bars seem to have pretty uniform brightness, mostly independent of viewing angle.
I don't think an ir-sensor based solution is out of the question... the problem seems to be that nobody can find the sensors other than just buying the arcade guns. If a robust avr, say a teensy, was used to build the kit it should be fairly trivial to blink some leds in sequence and read the values as they are turned on. The thing is.. what kind of equation are they using to get the x/y? I'm sure it's some kind of triangulation, but could any of us code something good enough to get a similar result?I surely could code that, with the triangulation calculations I made for the 4 led system, adapting the logic to an IR sensor shouldn't be that hard.
I don't think an ir-sensor based solution is out of the question... the problem seems to be that nobody can find the sensors other than just buying the arcade guns. If a robust avr, say a teensy, was used to build the kit it should be fairly trivial to blink some leds in sequence and read the values as they are turned on. The thing is.. what kind of equation are they using to get the x/y? I'm sure it's some kind of triangulation, but could any of us code something good enough to get a similar result?
It's true that the system is stand-alone but what it outputs is no more complicated than an analog joystick. You can actually use an analog stick to control Sega type 2 gun games. All the work to translate voltage to coordinates is done on the other side. You need to physically tell windows which voltages = the screen edge.
It also relies heavily on the screen out feature (digital button 3 on my UHID) to know when to stop tracking. It loses all accuracy when I disconnect the screen-out cable.
The gun sense boards are big but most of the space is taken up with voltage regulators, pots and ports. The actual IC chip is fairly small and I am sure you are right that a modern AVR or Arduino could do the same and then some.
I'm wondering if the IC chip from the gun sense boards has already been dumped for one of the emulators. If it has, would someone with your programming knowledge be able to see how it works?
It's true that the system is stand-alone but what it outputs is no more complicated than an analog joystick. You can actually use an analog stick to control Sega type 2 gun games. All the work to translate voltage to coordinates is done on the other side. You need to physically tell windows which voltages = the screen edge.
It also relies heavily on the screen out feature (digital button 3 on my UHID) to know when to stop tracking. It loses all accuracy when I disconnect the screen-out cable.
The gun sense boards are big but most of the space is taken up with voltage regulators, pots and ports. The actual IC chip is fairly small and I am sure you are right that a modern AVR or Arduino could do the same and then some.
I'm wondering if the IC chip from the gun sense boards has already been dumped for one of the emulators. If it has, would someone with your programming knowledge be able to see how it works?
Unfortunately I don't think the chip has been dumped. Mame just reads the x/y values from the proper address and I always wondered how exactly they got x/y from a light gun game but now I know. I need to check one of these nerdy sites that do Arduino projects and see if someone has fooled with light sensors to detect ir leds. If doing it from scratch finding an appropriate sensor would be the first step.
Ok, Zebra. Here we go again.
You removed the IR Shield from the 4 sensors on the tiny pcb that is in the nozzle of the gun. What you also removed, is a rectangular ( maybe/probably square ) iris ( some plastic cap with a square hole in it).
This plastic cap has its opening in the middle of these 4 sensors which are just 4 flat photodiodes. If you shine a light on these photodiodes with the cap on, depending on which angle you shine, the amount of light that hits each individual sensor varies. if you happen to point the light straight at it, all 4 sensors get the same amount of light. The sega ir II system uses this difference in measured brightness to calculate the ANGLE of ONE* light source. This is why the IR diodes mounted on the screen are connected to the pcb, and not just to some power source. The ic`s of the gun system are synced, so that the gun can read all angles of the ir lights ONE after another. With this information ( all angles of all light sources) (and the position of the light sources which is obviously known since they are fixed) the system calculates its 6 degrees of freedom in relation to the screen, and converts the screen coordinates to 2 analog outputs for x and y. It also knows (just like ems topguns) when it is pointed offscreen, and returns that aswell.
I am 99% confident this is the way the ir II system works.
* I do not know how exactly they deal with outside light sources. Maybe they just read the photodiodes while no light is active, and subtract the intensities.
I'll try one more time, you've had two separate people explain this to you. The end output is created after processing. What do you think the cpu on that board is for? Yes it results in two analog values for x and y but that is just for ease of interface, it has nothing to do with how the sensors work. If there are indeed 4 photodiodes/transistors on the gun pcb, then it's working as I described before.... it turns on a led (or group of leds), reads all four values to guestimate it's position based upon the differences between those values, then moves to the next led/group of leds. Then all of the readings are compared and processed via some formula to give the screen position, then that position is converted back to an analog value so it can be interfaced out to the game pcb. Again, back to my original post, the trick is determining what formula they used and what combination of sensors and leds work similar enough for the rig to be replicated. Someone good at trig (i.e. not me) could probably put together a formula solution.If I understand correctly what has been explained here about this tech, the sensor is only measuring the distance with each led (light one by one in sync), and then calculates the aim with a trig calculation?
If I understand correctly what has been explained here about this tech, the sensor is only measuring the distance with each led (light one by one in sync), and then calculates the aim with a trig calculation?
It's actually very similar to what I am doing in my arduino sketch, so I guess if someone can find a cheap way to get those sensor, we could maybe make it work?
But to be honest, my IR cam and 4 led system is already on the way to become very reliable and stable, so I'm not sure it's worth the trouble.
Thanks for the info, makes more sense now!If I understand correctly what has been explained here about this tech, the sensor is only measuring the distance with each led (light one by one in sync), and then calculates the aim with a trig calculation?
It's actually very similar to what I am doing in my arduino sketch, so I guess if someone can find a cheap way to get those sensor, we could maybe make it work?
But to be honest, my IR cam and 4 led system is already on the way to become very reliable and stable, so I'm not sure it's worth the trouble.
Almost.
The gun does NOT calculate the distance to each single point. It actually calculates the angle/direction of each light relative to the gun, just like the ir camera does in your script. (every pixel of any camera represents just the intensity of light at that specific angle). So after the ir II got the angles (which are the coordinates in your script) it solves the Perspective-n-Point problem, just like the ems topgun and your script does.
I think no lightgun measures any distances to anything. Even if it did, the distance alone wouldn`t give any valuable information. if you only know the distances to 3 fixed points, you can only calculate where the gun is, not where the gun is pointing at, and we want the latter. Think about that, @Zebra.
Happy New year, till 2020 guys :)
Finally recieved my 5mm 940nm leds :D
And can confirm that they do work fine from at least 1 meter.
Finally recieved my 5mm 940nm leds :D
And can confirm that they do work fine from at least 1 meter.
However this was with the old 2 point sketch, so i have yet to test the 4 point version.
I found by experimenting, that 3 leds in series, with a switching step-down regulator set at 3.8V works fine, even though their max rated voltage is 1.4v per led.
I 3D printed a small part to house the leds (first with 4 leds spaced too far from each other) which i will share on my github, which will be updated today with the model (stl and fusion360) along with my pcb designs.
https://github.com/Mysli0210/Liightgun (https://github.com/Mysli0210/Liightgun)
@Jaybee sent you a PM :)
Finally recieved my 5mm 940nm leds :D
And can confirm that they do work fine from at least 1 meter.
@Mysli0210 can you post a link for buy your led ?
thanks :)
could someone post a tutorial with photos and links of the precise components to buy? In particularActually it's on the work right now, I've finally found a pretty good solution that works well in any situation.
4 powerful 940nm IR LEDs with angle wide enough (at least 30 °) and
resistors, are they the same as samco project? 4x 100 ohm Resistors ? 4x Super-bright 5mm IR LED - 940nm 20 or 30 degree beam width ?
thanks a lot guys :)
All of the aboveI got these, actually nothing special.
Actually it's on the work right now, I've finally found a pretty good solution that works well in any situation.
I will post it soon, but here what you will need for a good setup:
- 8* SID1K10CM led or similar specs (they have an angle of only 30° but are very powerful)
- 4* 56ohms 1/4watts resistor
- 4* very small soldering boards or something similar
- 1* USB plug
- enough wire to connect each IR point to the next one
Basically the idea is that instead of getting a wide range angle led but having a pretty bad useful distance, I combine two led for each point, very slightly angled vertically to greatly improve angle.
If the LEDs are close enough from each other, the cam will see only one point, even from close distance without filter.
So each point consists in two LEDs and one resistor in series, which are then connected directly to the 5V USB power.
The total consumption of the whole 4 point system is around 200mA, so any USB power should work.
JayBee if you could send me the sketch so I can change the pins to fit my gun as is, I'll test it thoroughly today ;DFor different reasons I decided I won't share the sketch, just the firmware for the Atmega32u4 5V/16MHz (the ItsyBitsy boards miss some functionalities needed for this system to work flawlessly).
@JayBee thanks a lot, Great!I will share the diagrams later when I finally find the time to do them.
in the tutorial you will also put the diagram and components for the recoil circuit?
I will wait for it to start ;)
I forgot ... this card is ok for your project?
https://www.adafruit.com/product/3677
Only the Atmega32u4 5V/16MHz work with my firmware, the other boards miss some functionalities.
Well, i was kind of waiting for you to share it with me, not the general public. As you told me you would earlier.JayBee if you could send me the sketch so I can change the pins to fit my gun as is, I'll test it thoroughly today ;DFor different reasons I decided I won't share the sketch, just the firmware for the Atmega32u4 5V/16MHz (the ItsyBitsy boards miss some functionalities needed for this system to work flawlessly).
Only the Atmega32u4 5V/16MHz work with my firmware, the other boards miss some functionalities.
yes, of course, this board is: The ItsyBitsy 32u4 5V 16MHz and this specifications is the same?
ATmega32u4 onboad chip in QFN package
5V power and logic, 16MHz clock rate, 2KB RAM and 28K FLASH
USB bootloader with a nice LED indicator, AVR109 compatible (same as Flora, Feather 32u4, Leonardo, etc)
Micro-USB jack for power, USB uploading and debugging, you can put it in a box or tape it up and use any Micro USB cable for when you want to reprogram.
Can act as a USB HID Keyboard, Mouse, MIDI or plain USB 'CDC' serial device (default)
On-board 5.0V power regulator with 150mA output capability and ultra-low dropout. Up to 16V input, reverse-polarity protection, thermal and current-limit protection.
Low current 3.3V regulator output from chip, for small sensors
Power with either USB or external output (such as a battery) into VBAT pin - it'll automatically switch over
On-board red pin #13 LED
23 GPIO total - 6 analog in, 1x SPI port, 1x I2C port, 1x Hardware Serial port and 10 more GPIO, 4 of which have PWM
Can drive NeoPixels, connect to sensors, servos, etc.
Reset button for entering the bootloader or restarting the program.
thanks :)
Well it's the same chip, so no magic difference there.Cheap is good, but an ItsyBitsy 32u4 might be a better choice for JayBee's firmware than a Pro Micro due to the number of 32u4 ports not connected.
the only 2 things that might differ, but not matter is the bootloader might be different, though entirely not needed if you flash via an external programmer, as with any avr chip. And the physical location of the pins may differ on a different board.
But I reckon most people would get the pro micro clones as they're super cheap.
the ItsyBitsy boards miss some functionalities needed for this system to work flawlesslyDoes your firmware use any of the unconnected ports (pins) mentioned above, JayBee, or are the "functionalities" you mentioned something else? :dunno
Cheap is good, but an ItsyBitsy 32u4 might be a better choice for JayBee's firmware than a Pro Micro due to the number of 32u4 ports not connected.
ItsyBitsy doesn't have connections for two ports (pins) -- B0 (8 ) and D5 (22). Schematic here (https://cdn-learn.adafruit.com/assets/assets/000/049/818/large1024/development_boards_itsy5v.png?1514957571).
Pro Micro doesn't have connections for seven ports (pins) -- B0 (8 ), D5 (22), B7 (12), C7 (32), D6 (26), F1 (40), and F0 (41).
Does your firmware use any of the unconnected ports (pins) mentioned above, JayBee, or are the "functionalities" you mentioned something else? :dunno
Scott
I just went through all the pins specified in the original post, they are all found on the pro micro.Sounds good. ;D
I also think its a slippery slope, not keeping it open-source, since guys like samco, did make his project open on github, which is neat, cause we'd then be able to develop it much further, should JayBee set aside the project at some point.I agree that open-sourcing the project would be great.
Look im all for having a pre-compiled image, that people can just flash on specific boards and follow a simple guide, but those of us whom are tinkerers, should be able to customize it to their needs, which in turn could become features on newer versions.
So I decided that I had nothing better to do than rewire the gun and can confirm that tracking works at at least 3 meters (that's how long a cable I have) that's with the 3 led spots I made. No interference from other lights like the buttons on my arcade.You mean mirrored with my sketch? Or just as is? Did you test with samco's test sketch?
But as you might remember I didn't use the df robot camera but the wiimote one instead.
So it does not have a housing that I can just rotate, mine is locked in with glue.
the problem is that the entire coordinate system is mirrored which is the same as being rotated 180 deg.
:dizzy:
The main reasons I choose the Atmega32u4 is that it's dirt cheap, has more than enough power and pins for this use, and has way more resources available than any other models.It certainly is a great little processor. ;D
Now the reason why I decided to not share the code;Your code, your choice. Thanks for sharing the compiled firmware. :cheers:
But if you guys want I can still make other firmwares compatible with different device or pinout.Just wanted to check that:
You mean mirrored with my sketch? Or just as is? Did you test with samco's test sketch?
The DF Robot cams have a big tilts issue, they aren't correctly oriented.
But if you tell me how the axises are reversed I can make another firmware without the df robot inversion.
That image is the Rosetta Stone for your OP. :applaud:Yeah I should have joined it.
- Shows which "pin numbers" go to which pin. (some don't match the marks on the PCB)
- Shows that you're using a Pro Micro. (the specific Arduino you are using is not mentioned in the OP)
Please consider adding that image to the OP so it isn't overlooked here on page 4.
Scott
The model is actually written in the needed hardware list, "Atmega32u4 5V/16MHz".Yeah . . . that's not enough to identify which specific PCB you're using/recommending. ::)
The model is actually written in the needed hardware list, "Atmega32u4 5V/16MHz".Yeah . . . that's not enough to identify which specific PCB you're using/recommending. ::)
All of the AVRs in the chart above use that same processor/voltage/frequency combination -- with 5 different pinouts, markings, and board sizes.
Necessary info about the PCB, pinout, and markings is currently not in the OP.
"Arduino Pro Micro Atmega32u4 5V/16MHz" and adding the Rosetta Stone pic would convey that info.
Scott
- 8* SID1K10CM led or similar specs (they have an angle of only 30° but are very powerful)
@PL1 therefore Pro Micro and Itsy Bitsy 32u4 is the same board but with only different pinouts?The boards are very similar because a 32u4 processor only needs a few supporting components, and none of those change the way that firmware code is handled.
Did a little testing tonight (rotated my camera 180)Did you put the LEDs right in the border of the screen or on the outside border? For me it's extremely accurate, more than any solution I tested even real light guns on CRT ;)
I find that the accuracy is not sufficient to play with.
it seems smooth, but I find that the leds being offset outside the frame of the screen, makes it so that its not scaled 1:1
JayBee, you asked how you could prevent people from earning money off of it.
Well, you can release the project under creative commons CC BY-NC-SA license
I do believe you won't need anything specific, except for the wavelength, as mentioned earlier.
I run mine at the lowest voltage that is specified and works at 3 meters distance.
I bet I could go even lower ;D
Did you put the LEDs right in the border of the screen or on the outside border? For me it's extremely accurate, more than any solution I tested even real light guns on CRT ;)
But I had to get LEDs good enough to avoid any flickering (and so loss of position).
Well I placed them as you see in the pictures I posted, they are around 10 mm off the border of the screen.Did a little testing tonight (rotated my camera 180)Did you put the LEDs right in the border of the screen or on the outside border? For me it's extremely accurate, more than any solution I tested even real light guns on CRT ;)
I find that the accuracy is not sufficient to play with.
it seems smooth, but I find that the leds being offset outside the frame of the screen, makes it so that its not scaled 1:1
JayBee, you asked how you could prevent people from earning money off of it.
Well, you can release the project under creative commons CC BY-NC-SA license
But I had to get LEDs good enough to avoid any flickering (and so loss of position).
Creative commons won't prevent anybody to use my code, since there is no way to check if they are using it unless they share it too :lol
I do believe you won't need anything specific, except for the wavelength, as mentioned earlier.
I run mine at the lowest voltage that is specified and works at 3 meters distance.
I bet I could go even lower ;D
i found these OSRAM SFH 4546 : High Power Infrared Emitters 5mm 940nm 130 mW/sr 1.5 V 100mA 40° deg 12ns
will they work?
and what resistance should i use for these?
always 56 ohms 1/4w?
Thanks a lot guys for support :)
The 4 IR LEDs system is finally here!
Instead of using the usual 2+ LEDs sensor bar, this system uses one LED in the middle of each side, which allows a far better aiming system overall.
I also added tons of features, and will keep it updated whenever needed.
Well reflections could make some interference. but remember, IR light does not pass through all glasstypes equally.Did you put the LEDs right in the border of the screen or on the outside border? For me it's extremely accurate, more than any solution I tested even real light guns on CRT ;)
But I had to get LEDs good enough to avoid any flickering (and so loss of position).
@JayBee on my cab i will have to put the leds on the sides of the crt monitor behind the bezel glass or in front of the sides of the glass? my cabinet is classic arcade cab with crt monitor 15khz hantarex polo slightly inclined, this inclination or
reflections of the glass they can create problems to precision of the gun?
thanks! :)
Well I placed them as you see in the pictures I posted, they are around 10 mm off the border of the screen.Are your TV and games 16/9 or 4/3?
As for the leds I do think these are perfect for the purpose, as it tracks them fine, but as I said, the scale is just wrong
No you can't, but if you have it licensed you can prove ownership. If you do see the code.
I do have an idea as to how to compensate for the offset.
if you initialize serial, which will respond to numbers which could be percentage of screen width.
With this offset you could just inset the mouse coordinates.
I do know its not easy to program something like this. And still think your work is awesome, even though I can't hit a damned thing ;D
To answer to your questions:
Thanks a lot, JayBee. I was looking for something like this since I tested Hifi's code on a Wiimote.
May I ask you some questions?
- I understand the builds you refer are those you describe here: http://forum.arcadecontrols.com/index.php/topic,161192.0.html (http://forum.arcadecontrols.com/index.php/topic,161192.0.html), which use a Namco Guncon 1. But, do you have any experience with a Namco Guncon 2? Do you think the whole build (including the solenoid) could fit in a Guncon 2 considering also the additional buttons it has? I'm particularly interested in using the button under the handle instead of a separate pedal.
- How do you feed the rumble motors? Do you use the VCC output of the Arduino? or the 5V line of the USB cable? Or do you use a similar driver as the solenoid and an external power supply?
- Regarding leds, I saw at different places that the optimal led for the Wiimote camera is the Vishay tsal6400. It's a 100mA 25 angle led with UV coating. Since the DF Robot camera seems to be very similar to that of the Wiimote, they may also be adequate.
Thanks![/list]
But I am indeed also working on a guncon 2 right now, because like you said the handle button is so convenient. I managed to fit most of the main stuff inside, and all buttons work nicely (even the dpad), but right now I'm struggling to fit a mini solenoid in, which isn't easy to say the least :banghead:
Well I placed them as you see in the pictures I posted, they are around 10 mm off the border of the screen.Are your TV and games 16/9 or 4/3?
As for the leds I do think these are perfect for the purpose, as it tracks them fine, but as I said, the scale is just wrong
No you can't, but if you have it licensed you can prove ownership. If you do see the code.
I do have an idea as to how to compensate for the offset.
if you initialize serial, which will respond to numbers which could be percentage of screen width.
With this offset you could just inset the mouse coordinates.
I do know its not easy to program something like this. And still think your work is awesome, even though I can't hit a damned thing ;D
If it's 16/9 TV with 4/3 content, you have to switch the screen ratio mode by briefly pressing the calibration button once.
If it's a 4/3 TV, press the button one more time.
It should magically correct the ratio, no need to manually calibrate or anything ;)
It's all written in the first post, but I understand that it's confusing.
For the screen mode you can actually change them automatically with mamehooker through serial commands, but I haven't finished the tutorial for that.
For the border even if the led isn't directly on border of the screen, it should still work fine, minus a slight offset on borders that isn't really a problem for old games. And only 10mm should definitely not matter.
Tell me if it fixes the issue, I will help you until we manage to make it work properly.
Very nice, you've been doing some good research too on the subject ;DBut I am indeed also working on a guncon 2 right now, because like you said the handle button is so convenient. I managed to fit most of the main stuff inside, and all buttons work nicely (even the dpad), but right now I'm struggling to fit a mini solenoid in, which isn't easy to say the least :banghead:
Thanks for the details!
Regarding the mini solenoid, I have used this very tiny solenoid for another project: https://www.aliexpress.com/item/32987722435.html?spm=a2g0s.9042311.0.0.dc534c4doWaC1d (https://www.aliexpress.com/item/32987722435.html?spm=a2g0s.9042311.0.0.dc534c4doWaC1d)
It has the convenient feature of working well with a 5V 2amp power supply, so it can be feed with a powered USB line.
For the controller board, I've used this cheap pre-made one: https://www.aliexpress.com/item/33038728761.html?spm=a2g0s.9042311.0.0.dc534c4doWaC1d (https://www.aliexpress.com/item/33038728761.html?spm=a2g0s.9042311.0.0.dc534c4doWaC1d)
It completely decouples the power and control lines, as you can se here: https://bogza.ro/index.php/FR120N_Isolated_MOSFET_MOS_Tube_FET_Relay_Module (https://bogza.ro/index.php/FR120N_Isolated_MOSFET_MOS_Tube_FET_Relay_Module)
And, regarding the rumble motor, smaller alternatives to the xbox rumble motor could be the rumble modules of the xbox one controller triggers or of the ps3 move. On the contrary to the Wii motor, those have a mini unbalanced weigth and may produce a better effect. These can be found in ebay:
https://www.ebay.es/itm/Vibration-Rumble-Motor-M10-Replacement-For-Microsoft-Xbox-One-Controller/132845524127?hash=item1eee35d49f:g:IesAAOSwoDlb4EZj (https://www.ebay.es/itm/Vibration-Rumble-Motor-M10-Replacement-For-Microsoft-Xbox-One-Controller/132845524127?hash=item1eee35d49f:g:IesAAOSwoDlb4EZj)
https://www.ebay.es/itm/2-Units-Handle-Vibration-Rumble-Motor-Motors-Replacement-For-PS3-Move-Controller/122490167409?hash=item1c84fba071:g:d68AAOSwcB5ZFDxl (https://www.ebay.es/itm/2-Units-Handle-Vibration-Rumble-Motor-Motors-Replacement-For-PS3-Move-Controller/122490167409?hash=item1c84fba071:g:d68AAOSwcB5ZFDxl)
Dude I did check your photo already, but 1. We can barely see anything in them, and 2. I used TV as a generic term, TV or simple screen doesn't matter on this system.Well I placed them as you see in the pictures I posted, they are around 10 mm off the border of the screen.Are your TV and games 16/9 or 4/3?
As for the leds I do think these are perfect for the purpose, as it tracks them fine, but as I said, the scale is just wrong
No you can't, but if you have it licensed you can prove ownership. If you do see the code.
I do have an idea as to how to compensate for the offset.
if you initialize serial, which will respond to numbers which could be percentage of screen width.
With this offset you could just inset the mouse coordinates.
I do know its not easy to program something like this. And still think your work is awesome, even though I can't hit a damned thing ;D
If it's 16/9 TV with 4/3 content, you have to switch the screen ratio mode by briefly pressing the calibration button once.
If it's a 4/3 TV, press the button one more time.
It should magically correct the ratio, no need to manually calibrate or anything ;)
It's all written in the first post, but I understand that it's confusing.
For the screen mode you can actually change them automatically with mamehooker through serial commands, but I haven't finished the tutorial for that.
For the border even if the led isn't directly on border of the screen, it should still work fine, minus a slight offset on borders that isn't really a problem for old games. And only 10mm should definitely not matter.
Tell me if it fixes the issue, I will help you until we manage to make it work properly.
Well its not a tv, which you would have known if you looked at the pics I uploaded earlier in the thread.
the screen is actually 5:4 but that's pretty close to 4:3
It definitely doesn't seem like the aspect ratio is the problem, but rather that 10mm offset.
On the center of the screen the offset is not felt, but it feels like a gradiently increasing offset the further you get to either edge. Which to me seems logical.
However I do understand why you'd think 10mm shouldn't matter that much, cause on a large tv, it's a small percentage of the screen size.
But my screen is only 19"
Which in 5:4 format is 38cm wide, with an offset of 10cm on either side, this becomes 40cm
40/38 is 1.05 so therefor there is a 5 percent error on the edges of the screen. In this particular case. [/list]
EDIT:
As for mamehooker, i dont use mame at all, i find it running very poorly in retropie, and super confusing to set up properly due to some versions running some games better than others.
Using those small motors is a good idea, I might look into that too! Did you find the specs somewhere?
I did a quick search but couldn't find any (Size, voltage, current)
I attached a pic of the motherboard of the GCon2, after being stripped of all unsused components and with the Arduino wires soldered. I lost my paper where I wrote down which point is what, but pretty much the connector on the right contains the gun handle buttons (trigger, reload, d pad) and the common ground, while the other buttons can be taken from other points on the motherboard.
The main issue I had with non controller vibration motor is that even if they take only 3~5v, they aren't power efficient enough to work with the Arduino and require an extra power supply to even start (bought few different to test out).Using those small motors is a good idea, I might look into that too! Did you find the specs somewhere?
I did a quick search but couldn't find any (Size, voltage, current)
I attached a pic of the motherboard of the GCon2, after being stripped of all unsused components and with the Arduino wires soldered. I lost my paper where I wrote down which point is what, but pretty much the connector on the right contains the gun handle buttons (trigger, reload, d pad) and the common ground, while the other buttons can be taken from other points on the motherboard.
The specs of the xbox triggers rumble motors can be found here:
https://www.ebay.es/itm/2pcs-Microsoft-gamepad-Vibration-motor-Large-vibration-DC3V-5V-N10-motor-DIY/323696171526?hash=item4b5dcb9a06:g:yJ4AAOSwMoZcZt9o (https://www.ebay.es/itm/2pcs-Microsoft-gamepad-Vibration-motor-Large-vibration-DC3V-5V-N10-motor-DIY/323696171526?hash=item4b5dcb9a06:g:yJ4AAOSwMoZcZt9o)
For the PS3 move, I'm not completely sure, but it should be similar to this:
https://es.aliexpress.com/item/4000220703114.html?spm=a2g0o.productlist.0.0.4bfd4029g7X6tW&algo_pvid=100564c0-dd1c-493b-8f1c-717f4b18bc93&algo_expid=100564c0-dd1c-493b-8f1c-717f4b18bc93-24&btsid=eaeca679-c85d-46de-b2c7-4bade2229f95&ws_ab_test=searchweb0_0,searchweb201602_9,searchweb201603_53 (https://es.aliexpress.com/item/4000220703114.html?spm=a2g0o.productlist.0.0.4bfd4029g7X6tW&algo_pvid=100564c0-dd1c-493b-8f1c-717f4b18bc93&algo_expid=100564c0-dd1c-493b-8f1c-717f4b18bc93-24&btsid=eaeca679-c85d-46de-b2c7-4bade2229f95&ws_ab_test=searchweb0_0,searchweb201602_9,searchweb201603_53)
In any case, knowing the maximum volume that can be fitted in the handle, it could be possible to find a suitable motor of the many third party ones available in ebay.
And thanks for the photo of the guncon2! This saves a lot of work finding the pins to solder!
Yes my home made control circuit is very similar, however I've been using a n-channel mosfet (IRL540) because I've heard they work better for solenoids with the low current and voltage output of the Arduino. I also use stronger kickback diodes and additional resistors to protect everything.
Dude I did check your photo already, but 1. We can barely see anything in them, and 2. I used TV as a generic term, TV or simple screen doesn't matter on this system.
What matters is the aspect ratio of the content vs the aspect ratio the screen.
Since the mouse absolute position (or joystick axises in joystick mode) is relative to the content aspect ratio/resolution, but the aiming detection is relative to the aspect ratio detected with the 4 LEDs.
So if your content isn't stretched fullscreen, my sketch won't be able to match aiming and cursor position.
And the center is always in the center of the 4 LEDs no matter the screen or content.
That's why I added a quick aspect ratio correction switch (with one calibration button push) to prevent this issue and still have accurate aiming without calibration, mainly for 4:3 contents displayed in 16:9 screens.
Have you tried stretching your games fullscreen for test purpose?
EDIT: As for forced calibration, the one from the 2 point sketch seemed to work perfectly fine, the only real problem i had with the 2 point sketch was that you'd have to be further away from the screen to aim at the opposite side of the screen, from the leds that is.
Send me pics or video of how it behaves in full screen mode.
I've tested it with a 17" 4:3 screen with ~2cm border, and I had minimal offset on the sides.
Mamehooker is a Windows app that works independently from Mame. But yes it won't work with retropie. And I agree libretro mame cores are bad, outdated, not optimized and have awful latency.
I consider adding a forced calibration mode for anybody who has unusual screen ratio or larger borders. It might make it easier to fit any setup, but might also make it easier to mess things up if the calibration isn't done correctly.
Well sorry, it must have been misinterpreted, didnt mean any offense.Thanks for the pics! And very nice cab by the way :applaud:
As for the content, i tried with rescueshot for psx rendered in 1280x1024 ie. 5:4 in fullscreen.
but to debug it i just tested it on the desktop of the machine so i could accurately tell what was wrong.
I get that the mouse coordinates are defined in as absolute coordinates and that the center of the leds are always center of the coordinate system(therefor the individual axis is scaled according to the led position), except for the calibration offset, right?
I'll get some pics/video taken shortly :D
EDIT: I dont think forced calibration is a bad thing to have, i mean, what can it fook up?
on the 2 point sketch, it worked perfectly, IMO the only thing that the 2 point did poorly was track beyond the cameras limits... durrh :D
On these 4 pics i aim exacly at the border of the screen, as accurately as the ironsights on the gun allows for.
Thanks, it has a few super neat secrets within, which you'll get pics of later :)Yeah the eeprom wearing out was one of my concerns for this sketch.
Yeah i get to border of the screen when I aim for the leds.
Saving calibration to ROM don't seem like a bad idea, the only negative I can think of is ROM cell wear around 100-200K writes per byte. However I think you could justify getting another pro micro by then... Or we could make it use an external EEPROM via the i2c that the camera already uses and potentially the nunchuck.
I'll check the new firmware out tonight :D
Thanks, it has a few super neat secrets within, which you'll get pics of later :)Yeah the eeprom wearing out was one of my concerns for this sketch.
Yeah i get to border of the screen when I aim for the leds.
Saving calibration to ROM don't seem like a bad idea, the only negative I can think of is ROM cell wear around 100-200K writes per byte. However I think you could justify getting another pro micro by then... Or we could make it use an external EEPROM via the i2c that the camera already uses and potentially the nunchuck.
I'll check the new firmware out tonight :D
But I reduced the writing on it only when you successfully do a calibration. I doubt you would do 100k calibrations with your guns :laugh2:
That's also why I made a function that allows to switch between 16:9 and 4:3 in 16:9 (with pillarboxes) with one button press, and doesn't write anything in the eeprom.
Tell me if you need a firmware that is able to work with 4:3 content on 5:3 screen, it's super easy for me to do (just one value to change).
What you did just works!Glad it worked! ;D
however i do have one annoyance :( the fact that it enumerates as a joystick fooks up my retroarch setup.
Would it be too much trouble to make a version that only enumerates as a mouse?
This looks like a really awesome project, I'm definitely gonna build one.That's a good question, I definitely have to take some time measuring it ;D
how close can you get to a 55 inch without sacrificing accuracy?
i'm installed arduino ide but in \AppData\Local\Arduino15\
dir packages not present,
do I have to install anything else?
Arduino boards:
1. Install the avrdude programmer.
Windows: Files are located in the "avrdude" folder.
MAC OS: The recommended way is to install brew as per single liner available from http://brew.sh/ (http://brew.sh/) then install avrdude with:
brew install avrdude
Linux: sudo apt-get install avrdude
2. Windows only: Install the Arduino Leonardo/Mini bootloader driver located in the "avrdude\drivers" folder as per the instructions at https://www.arduino.cc/en/Guide/ArduinoLeonardoMicro#toc2 (https://www.arduino.cc/en/Guide/ArduinoLeonardoMicro#toc2)
6. Find the COM port/device assigned to the Arduino bootloader.
Windows: In Control Panel -- Devices and Printers, the bootloader port number is displayed in the device description when the board is put in bootloader mode by pressing the reset button (Micro) or double-click grounding RST 2x as described here (https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide/troubleshooting-and-faq). (Pro Micro)
MAC: ls /dev/tty.usbmodem*
Linux: Can be found via dmesg after pressing the Arduino reset button
7. Create a "miniArcade2.txt" file in the avrdude directory and insert the text for your OS.
Windows: Change "COMX" to the Arduino bootloader port i.e. "COM7"Quoteavrdude -p atmega32u4 -P COMX -c avr109 -U flash:w:MINIARCADE2.hex -U eeprom:w:EEPROM.eep -C avrdude.confMAC: Change "tty.usbmodemXXXX" to the bootloader device used by your Arduino i.e. "tty.usbmodem1411"Quote#!/bin/shLinux: Change "ttyACMX" to the bootloader device used by your Arduino i.e. "ttyACM0"
avrdude -p atmega32u4 -P /dev/tty.usbmodemXXXX -c avr109 -U flash:w:MINIARCADE2.hex -U eeprom:w:EEPROM.eep -C avrdude.confQuote#!/bin/sh8. Rename "miniArcade2.txt" to "miniArcade2.bat" (Windows) or "miniArcade2.sh". (MAC or Linux)
avrdude -p atmega32u4 -P /dev/ttyACMX -c avr109 -U flash:w:MINIARCADE2.hex -U eeprom:w:EEPROM.eep -C avrdude.conf
9. MAC or Linux: "chmod 755 miniArcade2.sh" to set the execution permission bits.
10. To program the Arduino, launch the .bat/.sh file immediately after pressing the reset button or double-click grounding RST to put the Arduino into programming mode. (the board only stays in programming mode for 8 seconds)
avrdude -p atmega32u4 -P COMX -c avr109 -U flash:w:MINIARCADE2.hex -C avrdude.conf
Assuming that the dfrobot cam is the same as the wiimote camera (which I think I proved by building my gun with it)Your calculations look accurate, thanks :applaud:
your 55" screen is around 121.62 cm wide, so according to https://www.wiimoteproject.com/wiimote-whiteboard/wiimote-camera-angles/ (https://www.wiimoteproject.com/wiimote-whiteboard/wiimote-camera-angles/)
you'd need to be 167.07 cm away from the screen to see the leds on the sides, not accounting for the vertically placed leds.
But as the vertical leds are placed at half that distance, you'd be able to divide the 167.07 by 2.
However you're still limited by how far away you can see the vertical leds as the height of the 55" screen is 65.99cm
which equals 123.13cm.
So I'd say 1.2 meters would be around the minimum distance you could use it reliably, I might be wrong though 😊
@kill_one later today i'll provide an alternative guide for flashing the pro micro with avr-dudess which is fewer steps but requires you to enter bootloader mode by shorting the rst (reset) pin to ground (can be done with any small metal object)
Yeah I have to improve the explanation for that in my post, to make it more clear and convenient.i'm installed arduino ide but in \AppData\Local\Arduino15\
dir packages not present,
do I have to install anything else?
Here are the avrdude install procedures from the miniArcade 2.0 User Guide. (pg 13)
- Not sure where Bruno originally found the driver for step 2.
- If you can't find it elsewhere, it is in the miniArcade 2.0 download files here (http://forum.arcadecontrols.com/index.php/topic,154126.msg1615622.html#msg1615622).QuoteArduino boards:
1. Install the avrdude programmer.
Windows: Files are located in the "avrdude" folder.
MAC OS: The recommended way is to install brew as per single liner available from http://brew.sh/ (http://brew.sh/) then install avrdude with:
brew install avrdude
Linux: sudo apt-get install avrdude
2. Windows only: Install the Arduino Leonardo/Mini bootloader driver located in the "avrdude\drivers" folder as per the instructions at https://www.arduino.cc/en/Guide/ArduinoLeonardoMicro#toc2 (https://www.arduino.cc/en/Guide/ArduinoLeonardoMicro#toc2)
Here are the avrdude programming procedures from the miniArcade 2.0 User Guide. (pg 14)
- Put a copy of JayBee's .hex file in the avrdude folder. (used in place of "MINIARCADE2.hex")Quote6. Find the COM port/device assigned to the Arduino bootloader.
Windows: In Control Panel -- Devices and Printers, the bootloader port number is displayed in the device description when the board is put in bootloader mode by pressing the reset button (Micro) or double-click grounding RST 2x as described here (https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide/troubleshooting-and-faq). (Pro Micro)
MAC: ls /dev/tty.usbmodem*
Linux: Can be found via dmesg after pressing the Arduino reset button
7. Create a "miniArcade2.txt" file in the avrdude directory and insert the text for your OS.
Windows: Change "COMX" to the Arduino bootloader port i.e. "COM7"Quoteavrdude -p atmega32u4 -P COMX -c avr109 -U flash:w:MINIARCADE2.hex -U eeprom:w:EEPROM.eep -C avrdude.confMAC: Change "tty.usbmodemXXXX" to the bootloader device used by your Arduino i.e. "tty.usbmodem1411"Quote#!/bin/shLinux: Change "ttyACMX" to the bootloader device used by your Arduino i.e. "ttyACM0"
avrdude -p atmega32u4 -P /dev/tty.usbmodemXXXX -c avr109 -U flash:w:MINIARCADE2.hex -U eeprom:w:EEPROM.eep -C avrdude.confQuote#!/bin/sh8. Rename "miniArcade2.txt" to "miniArcade2.bat" (Windows) or "miniArcade2.sh". (MAC or Linux)
avrdude -p atmega32u4 -P /dev/ttyACMX -c avr109 -U flash:w:MINIARCADE2.hex -U eeprom:w:EEPROM.eep -C avrdude.conf
9. MAC or Linux: "chmod 755 miniArcade2.sh" to set the execution permission bits.
10. To program the Arduino, launch the .bat/.sh file immediately after pressing the reset button or double-click grounding RST to put the Arduino into programming mode. (the board only stays in programming mode for 8 seconds)
(https://cdn.sparkfun.com/assets/6/d/3/4/a/523c8e23757b7fbe5f8b4584.png)
For JayBee's firmware, you don't need to reprogram the EEPROM, so use this for the Windows text in step 7.
- Change "COMX" to the Arduino bootloader port.
- Change "MINIARCADE2.hex" to JayBee's .hex file.Quoteavrdude -p atmega32u4 -P COMX -c avr109 -U flash:w:MINIARCADE2.hex -C avrdude.conf
Scott
Yeah I have to improve the explanation for that in my post, to make it more clear and convenient.Feel free to use/remix anything I've posted. :cheers:
Also if you don't want or can't use the reset pin, with any program able to access the Arduino com port just open a connection at 1200baud then close it.That might be handy for boards like the Pro Micro that don't have an onboard reset button. ;D
It will automatically trigger a reboot in bootloader mode, same as the rst pin would.
That might be handy for boards like the Pro Micro that don't have an onboard reset button. ;DThat's exactly what I was thinking of doing, and include it inside the zip file along with the hex file. Would make it so much more simple, including for me :lol
Maybe it's possible to write a single .bat file that opens a 1200 baud port, pauses long enough to ensure it is open, closes the port, momentarily pauses again, and runs avrdude to program the board.
Scott
Guess i dont have to create that avr-dudess guide anyways :PI just tested my gun with the last firmware, it still has the B button as middle click.
However, i have a slight problem. and a weird one at that!
I couldn't use the B button of my pistol in games, as it did the same as the A button. (B set up as start button in retroarch)
figured it was just the game, but tested in desktop, the startbutton didnt middleclick, it rightclicks.
the same applies when i try to map the keys in retroarch, it says mouse 2 whatever button i press :o
hooked it up to my pc, and fired up an online mousetest, every button is registered as mouse 2.
which is weird cause when i play rescue shot i can shoot and use the A button for grenade. but cant pause it just selects grenade just as the A button does.
I've connected the buttons according to your diagram.It's weird, I tested my GCon 1&2 with the same diagram, they both work perfectly with middle button.
I didnt connect the pedal pin to anything.
just needed left, right and middle mouse button.
Edit4: DONE! Now flashing the firmware is as simple as running the bat file ;D
That's be great if you guys could test it to see if it works properly for you ;)
I've connected the buttons according to your diagram.It's weird, I tested my GCon 1&2 with the same diagram, they both work perfectly with middle button.
I didnt connect the pedal pin to anything.
just needed left, right and middle mouse button.
Did you check the pins again just to be sure?
Be careful, pin A6 is pin 4 and pin A7 is pin 6 (I really have to make it more clear in my first post).
The trigger is activating the right click when pointing outside of the screen (for games with off screen reload), is that doing the right click on screen too?I've connected the buttons according to your diagram.It's weird, I tested my GCon 1&2 with the same diagram, they both work perfectly with middle button.
I didnt connect the pedal pin to anything.
just needed left, right and middle mouse button.
Did you check the pins again just to be sure?
Be careful, pin A6 is pin 4 and pin A7 is pin 6 (I really have to make it more clear in my first post).
I'll check just to be sure... Again d'oh
Edit: that fixed the middle mouse button. but the trigger still right clicks for some reason.
sure seems like it is, but the trigger works fine ingame, its just registered as mouse 2 in mousetest aswell as in the keybind on retroarch.If aiming onscreen, it should always register as mouse 1, if offscreen, always as mouse 2. If only some softwares see it another way it's probably a software issue ;)
@jaybee please where can I buy the same LEDs that you used? ;DActually I bough mine in a local shop here in Tokyo, and I think this model is japanese only.
@jaybee please where can I buy the same LEDs that you used? ;DActually I bough mine in a local shop here in Tokyo, and I think this model is japanese only.
But any LED with similar or close enough specs will work ;)
However don't buy them on aliexpress or similar chinese website, the ones they are selling are usually very bad quality and won't work as well.
If someone can tell us what's the best model they found in US or online... :cheers:
Not bad, they look like they'd work nicely!@jaybee please where can I buy the same LEDs that you used? ;DActually I bough mine in a local shop here in Tokyo, and I think this model is japanese only.
But any LED with similar or close enough specs will work ;)
However don't buy them on aliexpress or similar chinese website, the ones they are selling are usually very bad quality and won't work as well.
If someone can tell us what's the best model they found in US or online... :cheers:
i find in local shop in Italy this: http://pdf.icpdf.com/pdf4/LIGITEK/LIR33_datasheet_733433/119516/LIR33_datasheet.pdf
they should work but which resistance should I use for this?
thanks a lot JayBee
Not bad, they look like they'd work nicely!thanks JayBee!!! Can you post other images on how you connected the LEDs to each other and to USB power for beginners like me? : D
Here is the info I can get from the website I mentioned in the OP ;)
Since the specs are almost the same as mine, 56ohms resistors should also work, but you will get less brightness.
It might be hard to show anything more than the pics in the OP :PNot bad, they look like they'd work nicely!thanks JayBee!!! Can you post other images on how you connected the LEDs to each other and to USB power for beginners like me? : D
Here is the info I can get from the website I mentioned in the OP ;)
Since the specs are almost the same as mine, 56ohms resistors should also work, but you will get less brightness.
this the gun I'm working on is a Bio Gun for the first XBOX inside there is a rumble motor connected to an on off switch,The Arduino digital and analog pins don't provide enough power for rumble, so you will need a transistor or a mosfet to trigger the rumble from the Arduino, and have a separate motor power source.
can i use this by connecting it to the rumble and gnd pin of the pro micro or do i have to change it with one for xbox360?
The Arduino digital and analog pins don't provide enough power for rumble, so you will need a transistor or a mosfet to trigger the rumble from the Arduino, and have a separate motor power source.
I personally power my Xbox 360 rumble motor with the Arduino vcc, because it's 5 volts and doesn't take so much current. but it's not really a recommended solution, especially if you don't have the motor specs (voltage, current, resistance...).
But in the case your motor is powered only by the Xbox USB power, it should be fine too I guess.
I will post the list of components you need for the control circuit later when I go home ;)
Yes you understand correctly, each circuit has its own power and is connected to the corresponding arduino pin.The Arduino digital and analog pins don't provide enough power for rumble, so you will need a transistor or a mosfet to trigger the rumble from the Arduino, and have a separate motor power source.
I personally power my Xbox 360 rumble motor with the Arduino vcc, because it's 5 volts and doesn't take so much current. but it's not really a recommended solution, especially if you don't have the motor specs (voltage, current, resistance...).
But in the case your motor is powered only by the Xbox USB power, it should be fine too I guess.
I will post the list of components you need for the control circuit later when I go home ;)
so if I understand correctly, I connect solenoid and rumble or just one of the two to your circuit (still to be created) and feed it at 5v better with a second separate usb cable and then from this circuit the Rumble and Recoil pins on the arduino right?
There are actually 2 kind of control circuits I made, one for the rumble with the simple transistor, and a bigger one for the solenoid with a mosfet, because solenoids circuits need to be stronger than motor circuits usually.
Which circuit/components you will use will depend of the specs of your rumble and solenoid.
Hello JayBee news ? ;DI've been quite busy in my personal life lately, and also trying to pull a huge update for my firmware to address the last flaws of this system (minimum distance and maximum tilt), so it might take a while before I can do the schematics and components list :-\
That's awesome, man. I'm still waiting for the parts.Hello JayBee news ? ;DI've been quite busy in my personal life lately, and also trying to pull a huge update for my firmware to address the last flaws of this system (minimum distance and maximum tilt), so it might take a while before I can do the schematics and components list :-\
That's awesome, man. I'm still waiting for the parts.Well I'm not super good for the hardware side of things, so my way might not be the best nor the cleanest, but if you want to check anyway you can see my other thread, where I show the inside of the first 2 guns I made (saturn gun and guncon 1).
Looking forward to building this gun. Any tips about mounting everything in a guncon 1 or guncon 2?
Hello JayBee news ? ;DI've been quite busy in my personal life lately, and also trying to pull a huge update for my firmware to address the last flaws of this system (minimum distance and maximum tilt), so it might take a while before I can do the schematics and components list :-\
Does using this system make it track faster/better? Or is it more for 'no calibration'?Yeah, beside the no calibration it does work faster and better to some extend; it minimizes input latency, works from a wider angle, tracks a largers area, adds a good off screen tracking, and reduces greatly the minimum distance the player has to be from the screen.
https://photos.app.goo.gl/AcDxtFS8RYcwP36XAReally nice setup, good job! :applaud:
https://photos.app.goo.gl/gWf5H3t17kysawLd8
this is my first attempt, with the LEDs that I have taken I can stay at a maximum distance of one meter from the monitor, but considering that it is a 25" is okay! If I tilt the gun too much, the cursor goes crazy and is off-center, but it is a known problem, the trigger does not take the shot every now and then but maybe I have to better check the welded wire, the button B associated with the Middle mouse button if I try to configure it in MAME it does not insert anything and in mame it is seen the gun as GUNXX and the button A me it marks it the same as the trigger, in windows it works as a right mouse button.. apart from that it works great pointing very precisely and there is no flicker of the cursor! You are a great JayBee !!!;)
I can't do the calibration reset procedure, to overwrite the old calibration with new, how should I proceed?
now I just have to connect the rumble ... :)
Really nice setup, good job! :applaud:
You probably know that already, but just in case; your screen is not vertical but the leds have to be facing the gun as much as possible if you want the gun to see them correctly ;)
Yeah the issue with the tilt is that this system doesn't have gravity sensor to know how it's tilted, so when you turn the gun more than 45 degrees it doesn't know where the up is anymore.
But that's one of the things I am working on for the big upcoming update I'm busy preparing, so that should be fixed soon if everything goes well ;D
For the A and B buttons not behaving correctly, can you tell me for each of them how they are behaving in windows? (try them on a basic webpage, convenient to test the right and middle clicks)
Also, I just realized your gun has A B X Y start buttons and a dpad, that's very unusual, I'm curious to know on which pins you wired them all.
Looks really annoying to find good soldering points on the motherboard.
In Mame I'm not sure what's happening, but it looks like the gun axises aren't mapped correctly in the input menu?
If you can see the mouse cursor behaving correctly in the mame menu (outside of the game), it means it's indeed not mapped correctly.
For the calibration process it's very simple: hold the calibration button for few seconds (until the cursor goes to the middle of the screen), aim the middle of the screen, shoot, aim the top left corner of the screen, shoot again, aim the bottom right of the screen, shoot one last time. If the calibration process went well it should be calibrated and you shouldn't have to calibrate it ever again ;)
Tell me how it goes :cheers:
yes the screen is tilted and I put the pairs of LEDs exactly on the central sides of the monitor, but I don't know if the second LEDs on the right and left are seen because they are covered by the internal wood of the cab, If I put them vertically could it improve detection?You indeed have to place each leds point at the center of each side of course, but the leds have to be facing the gun camera because their angle is very limited. So if the leds are aligned with your screen they are facing upward and won't work correctly. And of course nothing should block their light. I checked your led specs again, and clearly if it's working at only one meter it's not normal, it should work from afar too if the leds angle is correct.
where having used this calibration procedure I was no longer able to have a certain precision, I had to reinstall the firmware and do the automatic calibrationReinstalling the firmware shouldn't change anything nor erase your calibration. The manual calibration is not overwriting the automatic calibration, but offsetting it to match your screen setup.
I think I found a bug perhaps in the last fw that you released 1.4, in practice it is the problem I had on the mame and on the calibration, in practice after various trigger pressures, the trigger Button becomes A Button...I did various tests, and I can tell you that both in mouse and joypad mode it does the same, Joy Button 1 becomes Joy Button 2 and then returns to normal when he wants...if I connect the trigger button to arduino pin B button it works well, Joy Button 3 always remains for example.It's not a bug it's a feature (see the "out of screen firing mode" in my original post). When firing offscreen it triggers the right trigger/button 2. It's used for the games that do reload by firing offscreen.
so I guess it's either a firmware bug or the defective arduino,so seen that at the moment I don't have another arduino to try, if you can verify this anomalous behavior please? :)
You indeed have to place each leds point at the center of each side of course, but the leds have to be facing the gun camera because their angle is very limited. So if the leds are aligned with your screen they are facing upward and won't work correctly. And of course nothing should block their light. I checked your led specs again, and clearly if it's working at only one meter it's not normal, it should work from afar too if the leds angle is correct.
If it's still firing the button 2 when aiming onscreen, it means the gun can't see your leds correctly.
On your second screen screenshot, the axises are mapped wrong, each axis has both gun axises mapped on it
Ok! Thanks! I put a little thickness on the top of the side LEDs to make them stand straight and now it is much better and the gun works even more than a meter, even if the cursor is less stable it starts to wobble a little ...Did you do the same for the top and bottom leds too? ;D
As you can see from the video below, in windows now works correctly the trigger always corresponds to the left mouse button while in mame it is always seen with Gunxx B0 both the trigger and A button, but is it normal that it is seen as a GUN and not as a mouse? Forces is this the problemI see, it's indeed not normal, it might have something to do with the way Mame is configured.
https://photos.app.goo.gl/ChUJJa1RvkU63Gwf9 (https://photos.app.goo.gl/ChUJJa1RvkU63Gwf9)
Inviato dal mio Redmi Note 5 utilizzando Tapatalk
Regarding this led shallow angle issue.... why don't you guys just sand the LEDS? That'll diffuse the light and they'll be viewable at any angle.We already discussed about that, but diffusing the light will also make it weaker and harder for the cam to see. The more the light spread, the dimmer it becomes, even with high powered higher angle LEDs ;)
Did you do the same for the top and bottom leds too? ;DOnly on top :D
I see, it's indeed not normal, it might have something to do with the way Mame is configured.I use a groovymame 64bit version and device mapping for lightguns set to lightgun if set mouse not work, can you post your mame.ini configuration
What do you have in "device mapping" in the Mame config menu? are you using any app for mame that might interfere with the inputs?
Well ages ago before there were third party sensor bars available for the wii I made one for use on the pc... had the exact same issue with the leds… then I sanded them and they worked great. I'd suggest you try it before deciding it's impossible.I never said it's impossible, I said it reduces the leds brightness therefore might reduce the maximal distance of use ;)
Only on top :DYou means the bottom leds are not facing the gun either? ;D
I use a groovymame 64bit version and device mapping for lightguns set to lightgun if set mouse not work, can you post your mame.ini configurationOk so let me test my groovymame machine once I finished setting it up again, I will send you the file.
You means the bottom leds are not facing the gun either? ;D
Ok so let me test my groovymame machine once I finished setting it up again, I will send you the file.
Any thoughts about these leds:Wait, 1190mW/sr?? That's insane :lol
https://www.arrow.com/en/products/l1i0-0940060000000/lumileds (https://www.arrow.com/en/products/l1i0-0940060000000/lumileds)
?
It's a surface mount, so might be annoying to install, but look at the specs.
maybe connect ten of those in series and use a 34V 1Amp ac adapter?Why would you want to use 10 of them? :lol
I'd also like to know if there's any danger associated with these leds.
Well, I've just finished building everything, i used the same leds you use, jaybee, SID1K10CM, 8 of them, connected everything, turned out the DFRobot camera needed to be rotated.I'm glad you manage to build it! :cheers:
In my case i had to manually calibrate the gun since the screen i'm trying this on is 16:10, i haven't connected it to the big screen yet since it was easier to try it on the 24 inch.
It seems to work but i'm not sure it works optimally, since i find myself having to sit as far as my old Topgun 2 lcd gun and still get some inconsistencies. If i try to get closer it does work but with more inconsistencies.
Is it supposed to be like this? I mean, did you also get accuracy issues from time to time? I've tried messing with the leds, changing their angles and so on, though can't say there's any improvement.
Will appreciate any suggestions.
Edit: two things that i've done that seem to help, i changed the usb cable from 5m to 1.8m and changed the resolution to 1920x1080 and set the screen to stretch so as not to have black bars since the native res is 1920x1200, and this time i didn't use manual calibration, since it's set to 16:9 res.
Not sure which of these two have helped the most but the gun seems to be more consistent now.
I mean that the lower LEDs are already straight and turned towards the gun because the screen is slightly inclined starting from the bottom and coming upwards therefore obviously the LEDs placed on the sides in the middle of the screen are slightly inclined and the upper ones even more stupid I who had not thought of that ... :)Oh I see, makes sense :P
thanks, but setting mouse as device for the lightgun should be seen as axes and mouse buttons right?I don't understand either, Mame is a bit obscure for me too sometime.
I don't understand why he doesn't read it like this
Yes the sensor is often tilted (it's a factory issue), as I wrote down in the first post :dizzy:Yeah, i've read the first post many times, just thought to point that out to share my experience with building it.
So for any aspects ratio other than 16:9 or 4:3, the resolution shouldn't matter as long as you keep your content in full screen.That explains it, why i was having issues with 1920x1200.
Just in case, you might also want to check how the camera is seeing the led by using the testing tool by Samco in this forum or or the one dfrobot provided. If you see the points blinking or changing color often, it means there is something wrong with them (USB port not powerful enough, connection problem...).For someone who has no experience whatsoever with arduino, how would i go around doing that?
Mame treats this gun as a lightgun, and that's how it's supposed to be, as far as I'm aware this has always been the case.I wondered for a while what's the best practice for the off screen shot functionality, and I ended up leaving it always on for few reasons;
This was the same case when i connected my guncon and other mouse based lightguns.
By the way, you should disable offscreen_reload for games that don't need it, so you can use the reload button for other things.
I think you can get around the offscreen_reload option by directly sending a 0,0 left button instead of sending a right button click as offscreen shot. Though I'm not sure if that will work with all games.
I don't understand either, Mame is a bit obscure for me too sometime.
Which input mode are you using inside mame?
Because I saw you were testing buttons in the windows controller panel in joystick mode.
You have to be careful, there are 3 input modes with my firmware; mouse+kb, joystick, and mouse+joystick
I made other gun and is the same in mame GUNXX B0...I deduce that it is not a problem of defective arduino, no one else has my same problem?Try setting offscreen_reload to 0 in mame.ini and check.
This time i used a wireless compatible guncon2 Logic3
(http://killone.myqnapcloud.com/GUN/gunlogic3.jpg)
(http://killone.myqnapcloud.com/GUN/gunmod.jpg)
(http://killone.myqnapcloud.com/GUN/sidea.jpg)
(http://killone.myqnapcloud.com/GUN/sideb.jpg)
I connected the calibration button to the OPEN button used to remove the battery container :D
@JayBee will the utility you are preparing also indicate the various active modes?
Try setting offscreen_reload to 0 in mame.ini and check.Yes! It was that! So should never be used offscreen_reload?
I just checked, mine shows GUN 5 B0 (5 is the mouse number detected by mame) when shooting on screen, and GUN 5 B1 for off screen, button A and pedal button (which is the expected behavior).
yes I think mouse + keyboard since when I press Start or Select I press the keys 1 and 5 but mame set Trigger and A button always to GUNX B0 and B button GUNX B2 Pedal button GUNX B0...
in the mame you use, does the trigger see it as MOUSE B1 or GUNX B1?
I made other gun and is the same in mame GUNXX B0...I deduce that it is not a problem of defective arduino, no one else has my same problem?Definitely not a defective arduino, you would have other issues I think.
@JayBee will the utility you are preparing also indicate the various active modes?With the current firmware, beside the calibration the gun should reset to the default configuration at each power cycle.
Oh so Foxhole's solution did work? nice, thanks! :DTry setting offscreen_reload to 0 in mame.ini and check.Yes! It was that! So should never be used offscreen_reload?
Foxhole thanks a lot :)
Oh so Foxhole's solution did work? nice, thanks! :D
Indeed in my ini file offscreen_reload was 0 by default too, I should add that to the FAQ ;)
Edit: @Foxhole I added the offscreen reload enable/disable option to the upcoming 1.4 version of the firmware, it will be easy to change it with a buttons combo.
Got tons of things to add and work on :lolcould you implement the possibility of various key combinations? I'm trying to edit a biogun for dreamcast and I realized that it has only two buttons besides the trigger and the DPAD, Start and A button
Use it only on games that require it, like lethal enforcers for example.Try setting offscreen_reload to 0 in mame.ini and check.Yes! It was that! So should never be used offscreen_reload?
Foxhole thanks a lot :)
kill_one, how's the gun working for you? Do you have issues from time to time? Can you also look at the video and tell me if you get these issues, too?Yes, but it rarely happens, in the troubleshooting there is written how to solve, I point out the screen at the bottom and shoot and then I raster the screen, I believe that with the next update the problem will be solved by fixing the inclination of the gun
most of the issues start on the second half of the video.
Yeah that's actually a good idea of features.Got tons of things to add and work on :lolcould you implement the possibility of various key combinations? I'm trying to edit a biogun for dreamcast and I realized that it has only two buttons besides the trigger and the DPAD, Start and A button
example: DPAD down + Start = Select button, DPAD up + A = B button, etc etc
thanks :)
Oh I see what's happening!Use it only on games that require it, like lethal enforcers for example.Try setting offscreen_reload to 0 in mame.ini and check.Yes! It was that! So should never be used offscreen_reload?
Foxhole thanks a lot :)
JayBee, i've included a video showing the issues i'm having.
https://drive.google.com/open?id=14N6tEnCCD_Psx24A7DaRW4N3R8QNZn80 (https://drive.google.com/open?id=14N6tEnCCD_Psx24A7DaRW4N3R8QNZn80)
kill_one, how's the gun working for you? Do you have issues from time to time? Can you also look at the video and tell me if you get these issues, too?
most of the issues start on the second half of the video.
Well ages ago before there were third party sensor bars available for the wii I made one for use on the pc... had the exact same issue with the leds… then I sanded them and they worked great. I'd suggest you try it before deciding it's impossible.So I gave it a try, and sanded one of my leds.
Tried that too, sanded the all 4 of them, made things worse in my case. The improvement in the angle is barely noticeable, but the power of the ir has been reduced quite a lot, reducing the range.Well ages ago before there were third party sensor bars available for the wii I made one for use on the pc... had the exact same issue with the leds… then I sanded them and they worked great. I'd suggest you try it before deciding it's impossible.So I gave it a try, and sanded one of my leds.
It seems like the sanding barely improved the angle, but made the light too dim to work correctly at more than 1.5 meters.
So overall it made it worse sadly :-\
My room is only 3 meter large, so I can't really go beyond :lolTried that too, sanded the all 4 of them, made things worse in my case. The improvement in the angle is barely noticeable, but the power of the ir has been reduced quite a lot, reducing the range.Well ages ago before there were third party sensor bars available for the wii I made one for use on the pc... had the exact same issue with the leds… then I sanded them and they worked great. I'd suggest you try it before deciding it's impossible.So I gave it a try, and sanded one of my leds.
It seems like the sanding barely improved the angle, but made the light too dim to work correctly at more than 1.5 meters.
So overall it made it worse sadly :-\
JayBee, according to the specs of the dfrobot ir cam it can detect up to 3 meter, have you managed to go beyond that?
New firmware update as promised! ;D
@foxhole & @kill_one
Since there are a lot of changes in my code, I leave it as beta version for now, until I'm sure it works.
If you can test it and give me your feedback that'd be great :cheers:
Next update should be the diagrams for the rumble and solenoid.
The calibration data should still be there after update ;)New firmware update as promised! ;D
@foxhole & @kill_one
Since there are a lot of changes in my code, I leave it as beta version for now, until I'm sure it works.
If you can test it and give me your feedback that'd be great :cheers:
Next update should be the diagrams for the rumble and solenoid.
Great @JayBee!!!
tonight if I can try it ... a question but once updated should the calibration be redone or the data is not deleted?
The calibration data should still be there after update ;)New firmware update as promised! ;D
@foxhole & @kill_one
Since there are a lot of changes in my code, I leave it as beta version for now, until I'm sure it works.
If you can test it and give me your feedback that'd be great :cheers:
Next update should be the diagrams for the rumble and solenoid.
Great @JayBee!!!
tonight if I can try it ... a question but once updated should the calibration be redone or the data is not deleted?
Perfect!!! :DYes, your guess was very good ;D
@JayBee Could you begin to interrupt us only the list of components to be taken to make the 2 circuits of the rumble and solenoid? So we already order them to be ready when you publish the schematics? :)
From one of the photos you put in the other thread I seem to understand that for the solenoid it takes: 1 Mosfet IRL540 - 1 kickback diode (1N4001 or equivalent can it be fine?) - 2 resistances (from what value?) And for the rumble which transistor to take?
Thanks a lot! :D
However I'm still not sure on how good an reliable those circuits are, electronic isn't my specialty so you're free to suggest any improvement ;)I'm not even a great expert in this field ...: D As far as rumble motor and solenoid are concerned, what specifications must they have besides being 5v?
I'm not even a great expert in this field ...: D As far as rumble motor and solenoid are concerned, what specifications must they have besides being 5v?The rumble can be anything up to 40v with an external power supply as long as it's not using too much power (just check the npn2222 specs)
I encountered two problems in this version ... the first one when I start flash.bat the firmware flash doesn't start, I had to rename the file and use the old one flash.bat. The second problem concerns the aiming, 'tilt now works but often when I aim at a point the cursor moves by itself making it impossible to hit the target, and sometimes the cursor is seen repeated on different points of the screen, ultimately it seems less precise than the version previous one. I hope I have been clear and helpful.that's weird, the flashing worked perfectly for me with the new flash.bat. I didn't change anything to it beside the name of the file :dizzy:
Here the video where at the end you see the duplicate cursor
https://photos.app.goo.gl/vjxYt4Wt9gqoVFi18 (https://photos.app.goo.gl/vjxYt4Wt9gqoVFi18)
The rumble can be anything up to 40v with an external power supply as long as it's not using too much power (just check the npn2222 specs)The Biogun Xbox port is 5v
If you want to use a 5V rumble motor connected to the arduino vcc, the motor has to have a very low power consumption, or else it won't work on the arduino power pin and might even fry it. That's why I use xbox 360 rumbles. But any USB powered rumble motor should work fine I guess?
For the solenoid, it has to be powered by a separate power supply, it can't be connected to the arduino.
The power will depend on your what your solenoid is rated for.
I use a 24v power supply since my solenoid are all 24v, but again, the IRL540 has quite a large working range (100V max).
Just don't forget to separate the power lines, and attach all grounds together.
The cursor duplication/jumping around (thanks for the video by the way) is clearly an issue with the cam seeing your leds "blicking" meaning it has trouble picking them up steadily :-\
On the old firmware that's the thing that would mess up the tracking and make your cursor move the wrong way.
On this one, it recalibrates and fixes the problem in real time, preventing the cursor to move in wrong directions, but making it blink sometime when doing so.
I just modified dfrobot led visualization tool to display/checks the leds and buttons, I will do a special firmware soon to go with it and share it with you ;)
For the aim moving on its own, you mean it's shaking?
For this new firmware because I'm reaching the limit of the arduino's memory, I tried to use integers instead of floats for the coordinates calculation, so it lost a little bit of precision. It didn't have much impact on my setup, but that probably depends on the size of the screen, distance and all. I might be able to do something about that if needed.
Could you please test this firmware and the previous one from the exact same distance/angle and hold the gun still to see how much it differs? :laugh:
Thanks for your help :cheers:
The Biogun Xbox port is 5vIf they are truly powered in 5v and don't use so much current you can use the Arduino vcc.
The Biogun DC port is 5v
since these two guns already have a rumble motor to use them, connect them directly to the circuit made and feed them to 5v externally? Even if the console ports are 5v, I doubt that the rumble goes to 5v is there a way to check the voltage without blowing them up? In that of DC there are soldered components, perhaps they serve to reduce the voltage? If so, should I leave them and feed at 5v?
The one for xbox that looks the same as the DC one instead had only two wires one connected to the onoff switch and the other went on the main board of the gun
I don't know how to proceed now: D
I do use a very similar solenoid, so yeah it should work fine!
i took these
do you think they are fine? the space left is very little with these I should be able to insert them...
can I power 2 solenoids with a single 24v power supply?
Well, the leds that i have at the moment are sanded so they are less powerful than what they used to be but i've tried them anyway with the new firmware,I will see if I can finish the tool tomorrow, I definetely want to check how the led detection behave on your system, to be sure to know where the issue is coming from.
and unfortunately it still suffers from the same issues, but this could very well be due to the leds themselves.
I need to get new ones and try, i thought about installing 12 leds, 3 on each point and run them to their max specs, meaning 100ma each led.
What are your thoughts about that, JayBee? Would that cause issues? A testing tool for the leds would help tremendously, so looking forward to that.
Also, I didn't get the issues kill_one got, just the same ones as before, sometimes moving the gun vertically makes it go horizontal and so forth.
Again, before jumping into conclusions i think testing with new leds is mandatory.
- 10k resistorDoubt...10k or 100k ? Because in the scheme there is a 100k resistance
Doubt...10k or 100k ? Because in the scheme there is a 100k resistanceI'm using 10k, but 100k should be fine too, it doesn't matter so much as long the resistor value is high enough to not short the data pin ;)
Which one to use? :D
I'm using 10k, but 100k should be fine too, it doesn't matter so much as long the resistor value is high enough to not short the data pin ;)
Thanks for your testing and videos :cheers:
Recalibrating the gun with the new firmware is much better it has come back to be precise, but it still happens that pointing to the center of the screen the cursor moves to the right and remains blocked on the right side or off-center on the right, then I have to tilt the gun several times on one side to make it return to normal and then also the cursor duplicated every now and then, I don't know if it can depend on the LEDs on the right, I will wait for the tool to check them :)
Link to video
https://photos.app.goo.gl/RVx1jzdREEV9iEfA7 (https://photos.app.goo.gl/RVx1jzdREEV9iEfA7)
I can see there is clearly a detection issue there, I'm interested to see how it react with the testing tool I just posted ;)
This is the circuit that I created, I used IRF540 which is equivalent to IRL540 then 1N4001 Res 1k 10k transistor 2222 and res 270ohm.Sadly the IRF540 isn't the same, it's a power gate instead of a logic level gate.
can you tell me if the connections are all correct or did i do something wrong? It only remains to be seen whether the motors I have are powered by 5v or 3.7v. :D
Sadly the IRF540 isn't the same, it's a power gate instead of a logic level gate.ahhhhhhhrgghhhhh! At the shop they told me it was the same ...: D oh well but the solenoid works the same even if underpowered?
The IRL540 will either fully open or fully close its gate when receiving a signal from the arduino, no matter the voltage.
The IRF540 will open the gate depending of the voltage it receives, with a maximum of 10v, meaning at 5v it will open half, your solenoid will be underpowered :-\
The 10k resistor should not be between the mosfet and the ground, but between the Gate pin and the Source pin of the mosfet.ah ok, thanks! As soon as IRL540 mosfets arrive that I ordered today I change the connections
And I think you reversed the gate pin and the drain pin of the Mosfet. I know it's confusing but the mosfet schematic pin order isn't the same as the real pin order.
I attached a pinout image for the mosfet.
JayBee, I'm trying your test firmware with the pde file but i get the exact same issues.You don't have any other device connected that might be using a serial port?
I flashed the test firmware, started JB_ircam_test.pde, pressed run, and i get a gray screen, just like with the dfrobot ir cam code.
I believe it doesn't open the right COM port, the com port is 13 but i don't see any manual way to choose it.
myPort = new Serial(this, Serial.list()[0], 9600);
By this line (if 13 is your arduino serial port):myPort = new Serial(this, "COM13", 9600);
That fixed it, it's working now.No it detects them only once, the second ones (slightly grayed ones) are with the tilt correction, it makes thing easier to check.
From what i can see it seems to detect each point twice(?)
gonna post a video soon.
Also, i installed the 12 leds, 3 in each point, with 100ma current going through them, they are brighter than before.I made another update, managed to find other causes of issues and fix them, it should work a lot better and more stable now.
Unfortunately, there are still issues, same ones as in my video, with all the firmwares, including the new 1.60, it tends to happen more often when coming from offscreen reload,
though i gotta say that with the new setup with the leds it's more stable than before, though not sure if it's because there are 3 on each point or because it's running on 100ma.
It's more playable now from about 1.3 meter, but trying to get closer results in more detection issues making it unplayable in games like point blank which require fast response.
I've uploaded a video of me testing the IR Test, this is with the first IR Test you uploaded, I'll also try the new one.Thanks for your video, I can see more clearly what's happening now :cheers:
https://drive.google.com/open?id=15bZ7yGlOgKJ37o0zE1ZBFgGQ65oOLFps (https://drive.google.com/open?id=15bZ7yGlOgKJ37o0zE1ZBFgGQ65oOLFps)
You don't have any other device connected that might be using a serial port?
The pde file is coded to connect on the first available port, but your arduino might not be the first one somehow :dizzy:
To manually force the serial port, in the pde file, replace this line:Code: [Select]myPort = new Serial(this, Serial.list()[0], 9600);
By this line (if 13 is your arduino serial port):Code: [Select]myPort = new Serial(this, "COM13", 9600);
Two more videos with the new IR Test firmware, I specifically wanted to show the difference between close and far, close = 70~85cm, far = 1.2M~1.3MWait, I don't see any issues in your videos :lol
You can see the issues when coming back from offscreen, much worse when being close.
Close: https://drive.google.com/open?id=1wqlxqMSKPuO2LOhYP1SfgMXWLFWhHr8F (https://drive.google.com/open?id=1wqlxqMSKPuO2LOhYP1SfgMXWLFWhHr8F)
Far: https://drive.google.com/open?id=1rdHbK-zS34g7Wl8AhOxh29Gxw4LC-e-x (https://drive.google.com/open?id=1rdHbK-zS34g7Wl8AhOxh29Gxw4LC-e-x)
Thing is, when trying to play close this causes issues.Two more videos with the new IR Test firmware, I specifically wanted to show the difference between close and far, close = 70~85cm, far = 1.2M~1.3MWait, I don't see any issues in your videos :lol
You can see the issues when coming back from offscreen, much worse when being close.
Close: https://drive.google.com/open?id=1wqlxqMSKPuO2LOhYP1SfgMXWLFWhHr8F (https://drive.google.com/open?id=1wqlxqMSKPuO2LOhYP1SfgMXWLFWhHr8F)
Far: https://drive.google.com/open?id=1rdHbK-zS34g7Wl8AhOxh29Gxw4LC-e-x (https://drive.google.com/open?id=1rdHbK-zS34g7Wl8AhOxh29Gxw4LC-e-x)
The leds are all moving and rotating correctly on the test tool.
Can you tell me what is the issue?
If it's the led staying black color when going back on screen after being out of range it's actually normal.
When losing track of all the leds (going off range), the system needs to see at least 3 leds again to know which is which.
It should actually need only 2 leds, but I disabled the 2 leds detection function on the last beta firmware to fix the 4 and 3 leds detection first.
I'm enabling it back right now, I will upload the next test firmware in few minutes if everything goes well ;)
Thing is, when trying to play close this causes issues.Yes I know, that's why I'm putting back the 2 leds detection function now.
Let me give you a scenario, you start a game of point blank, you're resting your hand, game starts and you need to shoot on the lower left of the screen, the gun will not fire, because you need to aim towards the center first. If playing from 1.2M it's not that big of a deal actually, but when close it's pretty much a deal breaker.
Great, i'll try the new firmware and report.The re-implementation of the 2 points detection is taking me a bit more time than expected, I need to change the way it work to fit my new code.
The re-implementation of the 2 points detection is taking me a bit more time than expected, I need to change the way it work to fit my new code.
so I who have 2 LEDs per point, shouldn't I use the latest firmware?Sorry for the confusion, I was talking about 2 points detection when going back onscreen, not 2 leds.
but is it normal that this happens in the test tool?Not normal at all... what's your screen resolution/refresh rate?
https://photos.app.goo.gl/pjzWq4PuFxzNEPZr7 (https://photos.app.goo.gl/pjzWq4PuFxzNEPZr7)
Not normal at all... what's your screen resolution/refresh rate?Windows 1024x240 60hz and Mame resolution is 2560x240 60hz :D
Great, i'll try the new firmware and report.Done! 2 points detection is back ;D
Windows 1024x240 60hz and Mame resolution is 2560x240 60hz :DOh, that explains the issue :laugh2:
it is a 15khz arcade monitor...
can the test window be set to fullscreen?
Edit: I just modified it to fit 640x480, and while I was at it I did another version for 1024x240 :lol
You will find them in the zip attached to this post
Unfortunately, with the new firmware, it still has issues when trying to play close.I see what's happening; from the way the corrected points (gray points) are oriented, the gun was tilted on the side when the cam went off range of the leds, and was in a different angle when back.
Included another short video.
Sometimes, even after detecting 2 leds they still stay black and the cursor is stuck.
Happens often while gaming.
https://drive.google.com/open?id=1qg0YXbC96wi5R3u6-aUxk0tMmtPkCWKj (https://drive.google.com/open?id=1qg0YXbC96wi5R3u6-aUxk0tMmtPkCWKj)
I'm still not an electronic specialist, but if I was you I would start powering them with a couple of AA batteries (so a total of 3~3.3V) to check how well they turn.
i found and removed these from an old broken usb joypad for pc, what happens if i power externally at 5v and i am not at 5v? They explode ??? : D
I think those of bioguns xbox e DC are 3v or 3.7v even if I don't find much info about it... how can I reuse them?
To be honest, when i had the issues i didn't intentionally cause them, it just happened during gaming.Damn, sad you still have issues... but don't lose hope, it's a work in progress but I'm sure with your guys help we will make it work in the end :lol :cheers:
As for the new IR test, any chance of having a regular firmware to try while gaming?
As with murphy's law, in the ir test things seem to be ok, but i can't know for sure until i can challenge the gun with actual gaming.
Edit: Scratch that, still having issues.
Gonna post a video soon.
Unfortunately i kinda messed up with the phone's camera but the important part is near the end, and you'll be able to see the cursor messing up.Yeah that's what I was talking about, the 2 points detection got messed up, then messed up the rest.
Video: https://drive.google.com/open?id=1zWEkAIouOJjYLIhZeE1PaEPkSsSMsr9- (https://drive.google.com/open?id=1zWEkAIouOJjYLIhZeE1PaEPkSsSMsr9-)
Thank you.That's interesting, do you know any good way to make donations?
As for the patreon, to be honest never used it but others may be on board.
Personally, i just prefer donating without any middleman.
Edit: I just modified it to fit 640x480, and while I was at it I did another version for 1024x240 :lol
You will find them in the zip attached to this post
I'm still not an electronic specialist, but if I was you I would start powering them with a couple of AA batteries (so a total of 3~3.3V) to check how well they turn.
And then try with a 5V power to see if they seem to turn faster/too fast.
Motors have quite a good tolerance for over voltage usually, so it shouldn't blow up or anything.
If it's USB there is a big chance it's 5V tho, 3V ones are more likely to be smaller than that and be in wireless controllers.
There are even motors that work with 7~9V in the PS2 Dual shock controllers, but they are turning a bit slow and weak with the arduino :lol
Sorry I forgot that the windows resolution is not 1024x240 but 1024x480: DIt's a normal behavior, it doesn't see 2 LEDs for each of the 4 points(the maximum LEDs this cam can pick up is 4)
the 2 LEDs are seen almost superimposed and I think that's how it should be, by tilting the gun, however, they divide and widen if point downwards there is a black point that moves and then the movements are reversed, that is, if point in top the LEDs move downwards etc. and the central white point seems to be decentralized on the right and the colored LEDs too far from the sides
https://photos.app.goo.gl/jFTm9qQSpsoyB2Xb6 (https://photos.app.goo.gl/jFTm9qQSpsoyB2Xb6)
https://photos.app.goo.gl/bUEDRdhdgwJJy2rT9 (https://photos.app.goo.gl/bUEDRdhdgwJJy2rT9)Not necessarily, it just means the system can see it, but doesn't know which of the 4 LEDs it is yet (Top, bottom, left, right).
but the black dots indicate that there is a problem with the detection of the leds?
Yeah the 5v looks correct for me.I'm still not an electronic specialist, but if I was you I would start powering them with a couple of AA batteries (so a total of 3~3.3V) to check how well they turn.
And then try with a 5V power to see if they seem to turn faster/too fast.
Motors have quite a good tolerance for over voltage usually, so it shouldn't blow up or anything.
If it's USB there is a big chance it's 5V tho, 3V ones are more likely to be smaller than that and be in wireless controllers.
There are even motors that work with 7~9V in the PS2 Dual shock controllers, but they are turning a bit slow and weak with the arduino :lol
you are certainly more experienced than me ...: D
3v
https://photos.app.goo.gl/JJTsMyCCysG7KhtG6 (https://photos.app.goo.gl/JJTsMyCCysG7KhtG6)
5v
https://photos.app.goo.gl/PH7Vb4YhUWR5b7jbA (https://photos.app.goo.gl/PH7Vb4YhUWR5b7jbA)
it seems that at 5v it is much faster ... does this mean that it must go to 5v or that it is in overvoltage and therefore it turns faster?
Yeah the 5v looks correct for me.
Well I think the worse that can happen is frying the motor, nothing much worse (I guess :lol)
But again, if someone better than me at electronics can confirm that to you that would be better ;)
But I just realized something funny: your gun is clearly picking up the scrolling light under your cab, and it messes with it :laugh2:
In the biogun xbox I identified an LM3940IT ic which from what I read is a Low Dropout Regulator for 5V to 3.3V Conversion so I believe that the motors in these guns are 3v can I use this between the 5v of the arduino and the rumble to reduce the voltage?If it looks like it's rated for 3V, you could use a small 5v->3v converter and connect it to the arduino 5v vcc, it should work fine.
I tested the 1.66 firmware and I must say that it is almost perfect for me apart that sometimes the cursor now ends and remains hooked to the bottom side of the screen ... Could it be the lights that drive the cam ir crazy ???It most likely is from what I could see in your last video :lol
If it looks like it's rated for 3V, you could use a small 5v->3v converter and connect it to the arduino 5v vcc, it should work fine.
Do you have a breadboard to do the tests?
rumble + to pin1Sorry I have no idea, I don't know this type of component so much :P
rumble - to pin2
Motor- to pin 2
Motor + to pin 3
to reduce the voltage to 3.3v, is it correct?
And regarding the solenoid, I have two only two blue cables, since it is not specified it has a positive and negative pole or is it indifferent how do I connect them to the circuit? Can I power the solenoid directly to 24v to test it without the circuit?I have one with 2 blue cables too, and it looks like there are no polarity, it probably contains a diode bridge of some sort.
I have one with 2 blue cables too, and it looks like there are no polarity, it probably contains a diode bridge of some sort.
For the test yeah you can power it directly, but be very careful tho, don't shock yourself, and don't leave the solenoid activated more than 1 or 2 second (it will most likely start overheating after few seconds of leaving it hold). do you have a push button of something similar to test it?
You mean an onoff button? I can get it but how should I connect it then?Definitely not an onoff button, you don't want your solenoid to be powered too long.
I meant a push switch, only closing the circuit when you push.I have arcade ones, but how is it connected to the power supply and the solenoid? :D
Like the buttons in arcade controls.
Be careful that it's strong enough to not get damaged by the 24v tho.
There are many ways of doing it, but in my case I just use an adapter to connect the power supply to normal wires (see attached pic), a breadboard, few wires and an old push button I use mainly for testing.I meant a push switch, only closing the circuit when you push.I have arcade ones, but how is it connected to the power supply and the solenoid? :D
Like the buttons in arcade controls.
Be careful that it's strong enough to not get damaged by the 24v tho.
There are many ways of doing it, but in my case I just use an adapter to connect the power supply to normal wires (see attached pic), a breadboard, few wires and an old push button I use mainly for testing.
I use only the left one on the picture, because my power supply already has connector like on the right.There are many ways of doing it, but in my case I just use an adapter to connect the power supply to normal wires (see attached pic), a breadboard, few wires and an old push button I use mainly for testing.
yes ok +24v e gnd of power supply to male connector and two pin blu to female connector right ? and push button where should it be placed?
sorry but I told you that I am even less experienced than you in this field ...; D
I use only the left one on the picture, because my power supply already has connector like on the right.
If your power supply only have raw wires you can just connect them directly.
The switch should be put between the 24v and the solenoid OR the GND and the solenoid, either wire is fine, it's just to close the circuit only when you push the button ;)
There! Now I understand: D ... By the way today try to cover the lights and see if the fall at the bottom of the cursor depends on that ... but which firmware should I use 1.67 or 1.66?The one I just posted :lol
Thank you, i'm gonna give it a good challenge :cheers:Yes both are updated.
Is the IR Test also updated?
Yes both are updated.
It's almost perfect now, i'm still having abnormalities now and then and since they are becoming more rare it's hard capturing it in video.Glad it's becoming better! :cheers:
I was playing Point Blank, everything seemed fine for 3 minutes or so, and then all of a sudden when i was aiming a bit to the lower left of the center the gun was shooting on the upper right, i think it somehow flipped the axis, though i wasn't coming from offscreen or anything, i was aiming to the lower right just a second ago and when moving to the lower left it somehow fired to the upper right. I can't seem to capture this in the IR Test, it's becoming much harder to reproduce these issues now since there are basically almost none now.
I'm gonna try a game like lethal enforcers 2 now, to test offscreen, will let you know the results.
I'm actually doing another version that can work with pretty much any resolution/COM port ;)
If you have time, could you make a 1024x480 version of the tool to test the LEDs? Thanks :)
The same issue happened more often in Lethal enforcers 2, i was aiming to the right edge of the screen and it fired just a tiny bit left to center, this leads me to believe it was detecting the Left LEDS and not the right LEDS.Gotcha. So is this issue the same as before or kind of new with the last firmware?
By the way, i think firmware 1.65 was perhaps the best for playing from afar (Over 1M), there were basically almost no issues.
The problems occur only when trying to get closer.
I think it was also in the older firmwares but we didn't pay too much attention to it because we believed it to be due to the offscreen.The same issue happened more often in Lethal enforcers 2, i was aiming to the right edge of the screen and it fired just a tiny bit left to center, this leads me to believe it was detecting the Left LEDS and not the right LEDS.Gotcha. So is this issue the same as before or kind of new with the last firmware?
By the way, i think firmware 1.65 was perhaps the best for playing from afar (Over 1M), there were basically almost no issues.
The problems occur only when trying to get closer.
The 1.65 was better from afar?
I think it was also in the older firmwares but we didn't pay too much attention to it because we believed it to be due to the offscreen.Indeed, the 2 points detection is great to aim in corners but obviously more prone to errors if there are any tracking issues :banghead:
1.65 was pretty stable because 2 point detection was off, so there were less mistakes when playing from afar.
If you'd like i can test firmware 1.65 more extensively from afar to see how it holds up in long gaming sessions.Ah, house of the dead 3, a very nice one to test ;D
I think i'll try it on House of the dead 3.
If you don't mind I will give you a test version of the last 1.68 firmware, but with the detection reset trigger a bit less sensitive, to see if it works better :PNo problem, let me know when it's up and i'll try it.
Do you think making this system an 8 point system would allow better stability when playing close?Yeah I really wish this cam could see more than 4 points at a time, it would be far better.
What i mean about 8 point is to add leds on the corners of the screen.
Never mind, just remembered that the dfrobot can only track 4 points.
Will try this firmware.That's good to know! I wonder if I should disable the 2 points detection automatically when playing from afar.
Would also like to mention that i played HOD3 almost to the finish with the 1.65 firmware and it was extremely good.
There was only one occasion when the cursor got stuck on the upper edge of the screen for no reason, but it fixed itself once i waved the gun,
but so far, in my opinion, firmware 1.65 is probably the best for playing afar.
gonna try the test firmware now.
That cool this firmware ...: DAwesome! We are almost there! ;D
I only noticed that the cursor seems to wobble more than before and in 10 minutes of the mame game (I always use Time crisis as a test) I also had the problem after 3-4 min that the cursor pointing to a point has moved in my case on the left but it happened only once and then it happens but now rarely see the duplicate cursor but for a moment and only if you point to the various sides of the screen, and it never happened to me during the action but only by moving the gun during the interludes ... We are close to perfection! :) Great JayBee!
If you have time, could you make a 1024x480 version of the tool to test the LEDs? Thanks :)I updated the pde file inside the test zip file, now you can edit 3 parameters at the beginning to setup your own com port and resolution ;)
Ok, i tested the new firmware from close distance, and i edited the video to highlight the issues.Very interesting to watch the video frame by frame to see what's going on! :cheers:
https://drive.google.com/open?id=1LijcW2NvTcthuvfSOxIeua8TS7CV4YIv (https://drive.google.com/open?id=1LijcW2NvTcthuvfSOxIeua8TS7CV4YIv)
In the first part, you will see the gun firing to the left while aiming right.
Second part, you will see the gun shooting offscreen when trying to shoot the cannonball.
In the third part, in the ir test, you will see the cursor getting stuck.
For the last part, I just noticed something, during just one frame you see the bottom IR point jumping on the right, which causes the detection error (the test tool has 2 frames delay more than the cursor, so you can see it happening 2 frames after the cursor stops).Hmm, reflection... the monitor is on a glass table.
It looks like the IR cam picked up something else, like a reflection of the leds on something?
Oh I see!For the last part, I just noticed something, during just one frame you see the bottom IR point jumping on the right, which causes the detection error (the test tool has 2 frames delay more than the cursor, so you can see it happening 2 frames after the cursor stops).Hmm, reflection... the monitor is on a glass table.
It looks like the IR cam picked up something else, like a reflection of the leds on something?
that might be it.
I'm gonna cover the area of the monitor with something to cover the glass, and i'll try the new firmware.
I updated the pde file inside the test zip file, now you can edit 3 parameters at the beginning to setup your own com port and resolution ;)the one on the front page?
Yeah now that it's more stable I will correct the wobble a little bit.
If still too much wobble I might also add a cursor smoothing option, but disable by default since it will add some latency.
Kill_one, what is the distance between your gun and the LEDS?
Tested the gun on a 42" inch 16:9 plasma.I'm glad we got it working the way it is, thanks for your careful testing it really helped :cheers:
In order to get a solid gaming session the gun had to be distanced at 2.3~2.4 meter, that means i was at about 3M away from the screen. To be honest, i stretched the game to 16:9, otherwise it would be very hard to play.
If i try to get closer and rely on 2 point detection, then the aame issues i had at the videos start to happen.
All in all, it's definitely better than a topgun or an aimtrak, no doubt.
If i was building a cabinet i would definitely go with this solution or maybe the sinden, though the sinden hasn't been tested yet by the community, so who knows what problems it may have.
JayBee, what are your plans, now? You said you are working on a software for the gun?
By the way, what's your paypal? I'd like to donate.
If you don't feel comfortable writing it on the forums feel free to pm me.
https://photos.app.goo.gl/h7n7cBqrzTkwGjpRA (https://photos.app.goo.gl/h7n7cBqrzTkwGjpRA)Wait, I still see your cab scrolling light under the stick, the one that messes up with the gun. You didn't hide/switched it off? :lol
because the leds top and right are not as bright as the others ?
Wait, I still see your cab scrolling light under the stick, the one that messes up with the gun. You didn't hide/switched it off? :lolThen covered or did not do the same problem and that is it moves down but rarely with the latest firmware: D
Also yeah, on cam the right and upper leds and very dim, maybe still not good angle?
Then covered or did not do the same problem and that is it moves down but rarely with the latest firmware: DYou mean it doesn't change when covered? It has to be fully covered (no light should pass through) or switched off anyway, the IR cam is clearly still picking up this scrolling light ;)
How can I go about arranging those LEDs better?
You mean it doesn't change when covered? It has to be fully covered (no light should pass through) or switched off anyway, the IR cam is clearly still picking up this scrolling light ;)yes, works the same way covered the leds or not...
If you can add one more led by point like Foxhole did (don't forget to change the resistor), and be sure the led are all pointing forward, it should work better.
yes, works the same way covered the leds or not...I see. Well you have to cover them anyway since the IR cam is picking them up, it will never work correctly if the cam is seeing more than the needed 4 led points :lol
what resistance would it take then? and would the 5v 1a power supply suffice?Wait, before building more hardware let's do a bit more testing with your current setup to be sure of what to do.
could the fact of the dim light of the upper and right LEDs be that sometimes the cursor duplicates or moves?
@kill_one
I added the fullscreen test tool in the main post ;)
Great! I'll try it as soon as I get home, you don't have to set the resolution right?Yes, it should work no matter the resolution ;)
Yes, it should work no matter the resolution ;)Last firmware test not work... It's normal
What do you mean by not working?Yes, it should work no matter the resolution ;)Last firmware test not work... It's normal
flashing the attached test firmware does not show the LEDs but only the mouse cursor, I attach the link to the videoWhat do you mean by not working?Yes, it should work no matter the resolution ;)Last firmware test not work... It's normal
I just tested both the last firmware with the last fullscreen tool, it works perfectly.
Did you change the com port to match yours? (It changes alone sometime)flashing the attached test firmware does not show the LEDs but only the mouse cursor, I attach the link to the videoWhat do you mean by not working?Yes, it should work no matter the resolution ;)Last firmware test not work... It's normal
I just tested both the last firmware with the last fullscreen tool, it works perfectly.
https://photos.app.goo.gl/L5QZzyAWVCAgy99b7 (https://photos.app.goo.gl/L5QZzyAWVCAgy99b7)
Did you change the com port to match yours? (It changes alone sometime)you're right I forgot to edit port com port in the pde file ... try again tonight! : D
And by the way why do you have a crosshair ? Is that a Windows cursor? :lolyes... :D i use this https://www.deviantart.com/zarpex/art/Weapon-Crosshair-Cursor-Pack-299011995 (https://www.deviantart.com/zarpex/art/Weapon-Crosshair-Cursor-Pack-299011995)
That's a really cool cursor pack! I'm going to try it on my arcade PC :DDid you change the com port to match yours? (It changes alone sometime)you're right I forgot to edit port com port in the pde file ... try again tonight! : DAnd by the way why do you have a crosshair ? Is that a Windows cursor? :lolyes... :D i use this https://www.deviantart.com/zarpex/art/Weapon-Crosshair-Cursor-Pack-299011995 (https://www.deviantart.com/zarpex/art/Weapon-Crosshair-Cursor-Pack-299011995)
I have to put this string "myPort = new Serial (this, "COM1", 9600);" otherwise it doesn't workNo no, you just have a value to modify at the beginning of the pde file now, there is even an explanation written in it ;)
In my opinion you should put a note on this on the first page ...: D
ah ok! thanksI have to put this string "myPort = new Serial (this, "COM1", 9600);" otherwise it doesn't workNo no, you just have a value to modify at the beginning of the pde file now, there is even an explanation written in it ;)
In my opinion you should put a note on this on the first page ...: D
The "comPort" value. Replace the 0 by whatever your port number is.
Yep, is very cool! I love it ;)That's a really cool cursor pack! I'm going to try it on my arcade PC :DDid you change the com port to match yours? (It changes alone sometime)you're right I forgot to edit port com port in the pde file ... try again tonight! : DAnd by the way why do you have a crosshair ? Is that a Windows cursor?yes... :D i use this https://www.deviantart.com/zarpex/art/Weapon-Crosshair-Cursor-Pack-299011995 (https://www.deviantart.com/zarpex/art/Weapon-Crosshair-Cursor-Pack-299011995)
https://photos.app.goo.gl/24YUJ6pBf3WQqWne6 (https://photos.app.goo.gl/24YUJ6pBf3WQqWne6)I think the dim leds are more because of the angle, on your tests it seems to be picking them up ok.
here you find various tests that I did yesterday, I have not yet figured out whether the points should be there or not, however in the game it works very well apart from time to time a duplicate cursor comes out for a second but it does it mainly in the interludes almost never during the game action, and I noticed that it does even if the gun points to the center of the screen, I think it may depend on the side and top LEDs that are less bright than the lower ones, it can center that the direct current reaches them and the others are connected to these in cascade?
Or could it be that the resistance is not working properly?
even if in the test the points see them all 4 so I have no idea why they are so dim
I think the dim leds are more because of the angle, on your tests it seems to be picking them up ok.tonight i try.. ;)
But I can see a bit more what's happening now; the camera is picking up points that aren't there, on the left and right side.
I suspect that the LEDs are being reflected on the inner sides of your cabinet.
Can you try orient the left and right LEDs a bit more towards the center? Or maybe for testing purposes you can put some tape on them on the outer side (or put some clothes to avoid reflection). and see if it's any better.
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!!! :DYes, it looks ok! :applaud:
I don't know if this is happening only to me or if it's an issue with the code or the arduino itself but i have noticed some issues.
The first one isn't a big deal but i think i should mention, sometimes after flashing a firmware the gun barely works, basically messing up with the detection and just works very strangely.
A simple unplug and replug of the usb cable fixes it. Is that happening only to me? This isn't consistent though, sometimes it works just fine.
The second issue, which is a bigger deal, is that sometimes when trying to change modes with the gun, basically pressing the calibration button or disabling off screen button 2, it will sometimes cause the gun to get completely stuck, forcing either to unplug and replug the gun or sometimes it's just enough to get the gun to its former state, for example if the gun was set to 16:9 mode and then i try and change to 4:3 in 16:9 the gun will get stuck, pressing the calibration button once again doesn't help since it's now changing to 4:3 mode, but if i press twice, bringing me back to 16:9 mode, it then starts working again, but of course i still have to replug the gun if i want to get to 4:3 in 16:9 mode.
The same issue happens when disabling offscreen reload (Mouse Button 2).
I haven't tested changing the settings with mamehooker, i'm only using the buttons for now.
Have you had this issue, JayBee? Any ideas what's causing this? The arduino perhaps? i'm using sparkfun brand arduino.
* 2020/02/16 - 1.75Thanks, JayBee, i haven't fully tested this firmware yet but i did run into two issues that i haven't faced before.
- 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.Thanks for the bug report! :cheers:
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.
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 would totally be possible once implemented!
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.
Yes, it looks ok! :applaud: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.
In the version 1.7 I restored the cursor accuracy, now it should be as smooth as before ;)
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!!! :DThe 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
(http://killone.myqnapcloud.com/sp/soleno.jpg)
Glad it's finally working for you!Yes, it looks ok! :applaud: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.
In the version 1.7 I restored the cursor accuracy, now it should be as smooth as before ;)
https://photos.app.goo.gl/6uXxnmVPUGW2mBTW8 (https://photos.app.goo.gl/6uXxnmVPUGW2mBTW8)
Do you have a continuity tester or a multimeter to test every connection?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!!! :DThe 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
(http://killone.myqnapcloud.com/sp/soleno.jpg)
Do you have a continuity tester or a multimeter to test every connection?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
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.
(http://killone.myqnapcloud.com/sp/sole.jpg)Where did you connect the solenoid power supply ground?
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?
No no, the solenoid connection is ok. I mean the 24v power supply ground ;)
Where is it connected?
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.
Yes it looks correct.
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.
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.yes there is an onoff switch but how should i connect it? : D
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.
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 (https://photos.app.goo.gl/GG1dY26B5tY9SB1f6)
DO you have any ideas about what I might be doing wrong , or is ther another way of doing this?
Thanks
Software needed:Don't install avrdude nor some dll, and don't change the installation files inside the zip file, just install Arduino IDE ;)
- Arduino IDE (this will just be needed to flash the firmware)
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.Oh I see!
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.
No need, everything is working perfectly, no point risking damaging it.Yeah the sparkfun model is actually the same as the generic ones I use, but 3~4 times more expensive somehow :lol
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.
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?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 (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?indeed it's not normal, I will test tonight.
DO you have any ideas about what I might be doing wrong , or is ther another way of doing this?
ThanksSoftware needed:Don't install avrdude nor some dll, and don't change the installation files inside the zip file, just install Arduino IDE ;)
- Arduino IDE (this will just be needed to flash the firmware)
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,Yeah you probably have to install the drivers that Foxhole suggested for your model ;)
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
I removed the installation of avrduse, removed the audrino ide and reinstalled it.Which version of windows and arduino IDE do you have?
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 . . .
---
C:\Users\<User folder>\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17
Inside the bin and etc subfolders (replace the <User folder> by your own folder name)
JayBee, do you have any idea how much current the arduino takes from the usb?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.
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?
* 2020/02/18 - 1.76Yeah!!! Top!!! :D
- 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)
Kill_one, the timeout has changed to 6 seconds, and it looks like it's a problem with your setup.
Change the timeout to 3 seconds in the bat file.
The rumble motor i'm using functions like a solenoid, when it rumbles it moves three gears which in turn pull the gun shell back to simulate the recoil.@Foxhole
Since i am only using rumble, then i should use the solenoid pin instead of the rumble pin, right?
Otherwise it won't work when shooting on screen?
I'd test this myself but i'm still waiting for the parts to arrive, so i'd like to make sure i'm doing this right.
Btw, the transistor isn't available at the moment, i can get the mosfet instead, do you think that would be an issue?
Foxhole is right, your board doesn't seem to like the 6 seconds timing.Kill_one, the timeout has changed to 6 seconds, and it looks like it's a problem with your setup.
Change the timeout to 3 seconds in the bat file.
It gave me error even with the version 1.75 set to 3s, I solved it using the flasher 1.70 on the second attempt ...I have no idea why :)
but to use the burst (autofire) holding the trigger in the games you have to use only mamehooker?You don't need mamehooker, fullauto mode is activated when holding the trigger more than 450ms.
You don't need mamehooker, fullauto mode is activated when holding the trigger more than 450ms.
So maybe it depends on the type of game? Because I had tried with Time Crisis but when I kept the trigger pressed only the solenoid was activated and in the game it didn't fireAh I see what you meant.
Time crisis doesn't have burst shots.Yes you're right. Good thing tho is that mamehooker works great with it, it makes it react exactly like the real arcade machine ;D
Personally, I'm more of a purist, if it wasn't in the game then i don't use it, but i think this deserves a poll, in case there are more people interested.Agreed. Will add it to my list of polls for the upcoming features :lol
By the way guys, are you interested in a auto reload function?
I saw some guns often have like a 6 shots autoreload, would that be something you would be using?
I haven't got time yet to prepare all the files for mamehooker yet, but I already got the one for Time Crisis, I can upload it once you got mamehooker setup and running.so does it take a configuration file for each game? tonight try to configure it following the guide of the official website, if you start posting the files for Time crisis or the games you have already ready it wouldn't be bad :)
so does it take a configuration file for each game? tonight try to configure it following the guide of the official website, if you start posting the files for Time crisis or the games you have already ready it wouldn't be bad :)I have only 2 ini files fully setup so far, the 2 I have been testing mamehooker with; Time Crisis and Terminator 2 8)
thanks a lot!!!
I added a poll about the upcoming RGB led support if you are interested ;)
I added a poll about the upcoming RGB led support if you are interested ;)
It means you can't have both, since they are using the same pins.
Leave the button pins as it is now, and disable the pedal, start and dpad right buttons when the RGB led is active, are the keys deactivated only when the RGB LED is active?
I added a poll about the upcoming RGB led support if you are interested ;)
An alternative to a standard RGB, which requires 3 PWM outputs, is to use a single Neopixel led, which only requires one digital output because it has an internal controller that interprets the digital data into colors and levels. They also operate on 5V. You may use SMD format leds or also through hole leds:
https://www.adafruit.com/product/1938 (https://www.adafruit.com/product/1938)
https://www.adafruit.com/product/1655 (https://www.adafruit.com/product/1655)
You can easly program them by using standard Arduino libraries, such as Adafruit's neopixel.
And, by the way, if you run out of pins, there is the possibility of desoldering the two RX and TX leds of the Arduino Micro board and repurpose them as digital outputs:
https://golem.hu/article/pro-micro-pinout/ (https://golem.hu/article/pro-micro-pinout/)
https://golem.hu/guide/pro-micro-upgrade/ (https://golem.hu/guide/pro-micro-upgrade/)
From what I understand the only pro micro PWM pins are 3-5-6-9-10,It means you can't have both, since they are using the same pins.
Leave the button pins as it is now, and disable the pedal, start and dpad right buttons when the RGB led is active, are the keys deactivated only when the RGB LED is active?
If you need those buttons you won't be able to use the led at all. Or not use those buttons at all.
The question is more about which button/pins should we sacrifice or move when using the LED.
Yeah I thought about the addressed RGB led too, it would be very convenient, but there is a problem with this option I couldn't find a solution to; I won't have space to add another library to my sketch, even with heavy optimization I'm already using 90% of the very limited Arduino space ;)AAAAAHHHHHH...rgggghhhh!!! :D
The other solution of hacking new pins is very nice too, but definitely not user friendly
Regarding the automatic reload function, would it be possible to add an autofire function when the trigger is kept pressed? Maybe holding down unloaded the whole magazine and then the automatic reloading starts while if you do not keep it pressed it fires one shot at a time and you have to reload manually? : DIt could be possible, but not as a default option, since it would prevent games that need trigger holding to work correctly.
But I guess I can add this to mamehooker if needed at some point?
I have installed mamehooker, configuring arduino com1 port, insert ini file to mamehooker ini mame directory and setting of tutorial mamehooker website, but in supported device no device is detectedIt's normal, Mamehooker doesn't "recognize" anything on serial ports.
It's normal, Mamehooker doesn't "recognize" anything on serial ports.
With my ini files it just sends raw data to COM1 and doesn't care about what the device is ;)
Yeah if you configured mamehooker and mame correctly, it should work.It's normal, Mamehooker doesn't "recognize" anything on serial ports.
With my ini files it just sends raw data to COM1 and doesn't care about what the device is ;)
so should it work already? which command should be entered to test if it works?
should something be set in mame.ini?
Yeah if you configured mamehooker and mame correctly, it should work.
I would recommend you to test it without ini files first, to see if mamehooker is reacting to mame and creates ini files from it.
If it doesn't, you missed something.
Yeah it should work.Yeah if you configured mamehooker and mame correctly, it should work.
I would recommend you to test it without ini files first, to see if mamehooker is reacting to mame and creates ini files from it.
If it doesn't, you missed something.
so i run mame hooker and i run mame then i launch a game and should i create an ini of the game in mame ini dir in mame hooker?
in groovymame 0.211 I have not set anything related to the outputs is it already configured for this?
* 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.Which version of windows and arduino IDE do you have?
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 . . .
---
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-arduino17
Inside the bin and etc subfolders (replace the <User folder> by your own folder name)
I m using Windows 10 pro and the latest version of the Audrino IDE which is 1.8.12
This is the only Audrino plugged in.
Flashing an empty sketch works fine.
There is no avr folder under the C:\Users\<User folder>\AppData\Local\Arduino15\packages\arduino\tools\ directlry (i replaced the <user folder>) the dir structure is ther and there are other folders under that level but no avrdude folder.
I don’t have the avrdude folder. It’s windows 10 64 bit.* 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.Which version of windows and arduino IDE do you have?
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 . . .
---
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-arduino17
Inside the bin and etc subfolders (replace the <User folder> by your own folder name)
I m using Windows 10 pro and the latest version of the Audrino IDE which is 1.8.12
This is the only Audrino plugged in.
Flashing an empty sketch works fine.
There is no avr folder under the C:\Users\<User folder>\AppData\Local\Arduino15\packages\arduino\tools\ directlry (i replaced the <user folder>) the dir structure is ther and there are other folders under that level but no avrdude folder.
In this folder there should be 2 subfolders (bin and etc), one containing avrdude.exe, and the other one containing avrdude.conf
You don't have those subfolders?
Is your windows 32 or 64bits?
I don’t have the avrdude folder. It’s windows 10 64 bit.
Sent from my iPhone using Tapatalk
I set it up like this my mamehooker default.iniyou shouldn't change the default file, or else it will overwrite the game settings ;)
[General]
MameHookerStart=
MameHookerStop=
MameStart=cmo 1 baud=9600_parity=N_data=8_stop=1, cmo 2 baud=9600_parity=N_data=8_stop=1, cmw 1 S, cmw 2 S, cmw 1 A2, cmw 2 A2, cmw 1 J0, cmw 2 J0
MameStop= cmw 1 s0, cmw 1 r0, cmw 1 E, cmw 2 E, cmc 1, cmc 2
StateChange=
OnPause=
OnRotate=
[KeyStates]
RefreshTime=33
[Output]
but in the debug window I don't receive any messages from the games, I can't understand what else I need to set ... :(
#
# OSD OUTPUT OPTIONS
#
output windows
I think I know the problem; in your mame.ini (in your mame directory) you need to change the output setting from whatever it is now to windows.Yes!
Like this:Code: [Select]
#
# OSD OUTPUT OPTIONS
#
output windows
[Output]
Player1_Gun_Recoil=
Player2_Gun_Recoil=
P2_Start_lamp=
the ini file it must be so ?[General]
MameStart=cmo 1 baud=9600_parity=N_data=8_stop=1, cmo 2 baud=9600_parity=N_data=8_stop=1, cmw 1 S, cmw 2 S, cmw 1 A0, cmw 2 A0
MameStop=cmw 1 E, cmw 2 E, cmc 1, cmc 2
StateChange=
OnRotate=
OnPause=
[KeyStates]
RefreshTime=
[Output]
Player1_Gun_Recoil=cmw 1 s0|cmw 1 s1
Player2_Gun_Recoil=cmw 2 s0|cmw 2 s1
P2_Start_lamp=
however, there are games where nothing comes out, such as Point Blank 1 while the JAP Gunbarl version does and Point Blank 2 as wellPoint Blank 1 don't have feedback on Mame, no matter the version, you can't make it work even by doing a manual ini file.
r0 e r1Yes those are correct ;)
if I want to use the rumble?
A0 in my case because I have the 4: 3 monitor
these settings are correct?
Point Blank 1 don't have feedback on Mame, no matter the version, you can't make it work even by doing a manual ini file.
If MameHooker doesn't create a new ini file when you starting new games, it's not supported.
You can of course manually create a ini file if you want to change some settings, but you won't get any feedback.
Ah ok! now I understand...I haven't found any :(
is there a list of supported games?
After changing the com port of one of the guns to com1 (it was written in use) the gun when I connect it to the usb port and it is detected on com1 the ir pointing no longer works, I tried to restart shut down but nothing, changing the port while the USB is detected and installed, the pointing works and then again it no longer works, even changing the com port does not work, I also tried to reinstall the firmware and recalibrate the gun nothing to do, the other gun instead always works regardless of the change of port com ... Is there a way to reset all the settings or remove and reinstall the drivers to restart from scratch?You assigned the COM port to one already in use, so the arduino stopped working.
I removed all the devices that use the com ports, checked the hidden ones, uninstalled arduino ide and usb drivers and reinstalled, when the gun is connected, arduino lenoardo com 8 is detected and while it does it works perfectly then stops after a while and no longer works, I don't think at this point that it's a COM port problem the LEDs in the ir camera and the Arduino are on so I don't think the USB cable broke ... I don't understand, the other two guns I made work regularly.
if I keep the calibration button pressed the cursor moves to the center correctly but the calibration reset procedure does not seem to work because when the usb cable is reconnected it is the same as before
When the gun stops working, are the buttons and feedbacks still working?
If yes, you probably have a weak connection with the cam.
If no, it's another hardware issue, you should check everything, like short circuits or anything that might cause the Arduino to freeze.
You can also leave your gun open to test if the Arduino led is blinking when you trigger buttons.
I meant a lose connection of the camera wires.When the gun stops working, are the buttons and feedbacks still working?
If yes, you probably have a weak connection with the cam.
If no, it's another hardware issue, you should check everything, like short circuits or anything that might cause the Arduino to freeze.
You can also leave your gun open to test if the Arduino led is blinking when you trigger buttons.
tonight I'll check ... but what do you mean by a weak connection with the cam?
I meant a lose connection of the camera wires.you mean SDA and SCL? Because the red led of the cam is always on
I mean any of the wires.I meant a lose connection of the camera wires.you mean SDA and SCL? Because the red led of the cam is always on
The flashing red LED of the keys when it stops pointing remains fixed and no key works anymore, I tried to reflect the firmware but it gives me an error, I changed the USB cable and it still blocks that the Arduino has skipped?
Don't try to reflash my firmware, I told you it's going to do more harm than anything else if the Arduino isn't working correctly.
Unless there is a firmware update, flash it only once. If anything wrong happens during the flash it can easily brick your Arduino!
There is obviously something wrong in your wiring that makes the Arduino freeze, the input LEDs should always blink when pressing keys no matter what, even if my firmware crashes.
Please check all the electronic/wiring again.
Are you sure the Arduino isn't on the same com port as another device anymore?Don't try to reflash my firmware, I told you it's going to do more harm than anything else if the Arduino isn't working correctly.
Unless there is a firmware update, flash it only once. If anything wrong happens during the flash it can easily brick your Arduino!
There is obviously something wrong in your wiring that makes the Arduino freeze, the input LEDs should always blink when pressing keys no matter what, even if my firmware crashes.
Please check all the electronic/wiring again.
I had tried to flash the test firmware but without results, the problem does it even with arduino and the 4 pins of the camera dfrobot only, i bricked arduino or ir camera defect? Although I don't understand why as soon as it connects to the USB port it works :dunno :banghead: :laugh2:
Sorry for reporting this only now but i had a lot going on.Thanks for reporting the bug :cheers:
i installed firmware 1.76 when you released it but i didn't get to use the gun since i was busy working on upgrading my cabinet.
I plugged the gun today to play some mame games and i immediatly noticed that the gun has developed some offset to the left, meaning i have to point beyond the right border of the screen for the cursor to reach the border.
The cursor is not centered when i'm aiming at the center, it's a bit to the left.
At first i thought it was the ir camera messing up so i tried recalibrating but that didn't help so i opened the gun and reseated the camera, still didn't help.
Checked resolution, aspect ratio and etc, and nothing helped and then i remembered that i installed the 1.76 and didn't test it, so i returned to firmware 1.75 and it's now working well.
Any idea what's going on with the 1.76 firmware?
Correction: The ir test does work, it's like the gun is somehow stuck in test mode, it doesn't move the cursor or respond to buttons at all.Ah it just means the EEPROM clear didn't work for some reasons.
Still the same.That's weird, I tested my 4 guns and they all worked fine :dunno
I'm using the dpad firmware.Still the same.That's weird, I tested my 4 guns and they all worked fine :dunno
Which version of the firmware did you flash?
Can you go in the Arduino IDE with the gun plugged, go into the serial command, type the capital letter D and press send?
It should give you some of the EEPROM data.
If it gives you numbers other than -1, it means the memory clear isn't working on your arduino from my batch for some reasons.
If that's the case, entering "ZC" (without the quote marks) in the serial command prompt should solve it.
Try that even if you don't get any numbers when typing D, just in case.
Edit: by the way, I made a discord server for support and news, it should be more convenient:
https://discord.gg/HJyfYja (https://discord.gg/HJyfYja)
I'm using the dpad firmware.It's even more strange, since the test app is working those serial commands should work as well (the test app is sending some serial commands too).
Typing D or ZC on the serial monitor brings no results whatsoever.
OK, it seems it's working again, i've tried the eeprom clear and the ZC Again, after reconnecting the gun it started working again.Yeah the serial should answer something only to the D command, but it's ok as long as the clear did work.
But, Aiming is off again, this time to the right of the screen and not the left, and the calibration button doesn't work.
Also, on the serial monitor i didn't get any reply whatsoever no matter what i typed.
I made sure that it's the correct com port.
Here is the new update, the biggest update so far since the very first release!
I added a ton of functionalities and made it ready for the future companion app I want to make.
As usual, feel free to tell me how it works for you :cheers:
* 2020/02/28 - 1.85 major update, please read the changelog carefully before updating!
- rewrote the whole flashing and config tool, now a lot more user friendly!
- made a double timing test to be able to flash any arduino. No need to modify the bat file anymore.
- various optimizations
- IR points detection bug corrected, it should be a bit more stable now
- reworked the buttons management
- merged normal and test firmware, now the test tool should trigger the test mode (replug the arduino once to reboot in normal mode)
- added RGB LED support for the 7 button + LED firmware! If your gun uses more than 7 buttons or if you don't want LED support please use the 11 buttons firmware
- added temperature sensor support! connect a tmp36 sensor to pin A0
- added rumble and LED feedbacks when changing modes
- added various LED feedbacks
- added EEPROM save and load gun data
- updated the game screen ratio modes for better usage and compatibility, now there are only 2; fullscreen and 4:3. Obviously changing this option will have no effect if you have a 4:3 screen.
- updated the test tool, now the one pde tool supports both normal and full screen, and has more options (don't use the old tools)
Here is the new update, the biggest update so far since the very first release!
I added a ton of functionalities and made it ready for the future companion app I want to make.
As usual, feel free to tell me how it works for you :cheers:
* 2020/02/28 - 1.85 major update, please read the changelog carefully before updating!
- rewrote the whole flashing and config tool, now a lot more user friendly!
- made a double timing test to be able to flash any arduino. No need to modify the bat file anymore.
- various optimizations
- IR points detection bug corrected, it should be a bit more stable now
- reworked the buttons management
- merged normal and test firmware, now the test tool should trigger the test mode (replug the arduino once to reboot in normal mode)
- added RGB LED support for the 7 button + LED firmware! If your gun uses more than 7 buttons or if you don't want LED support please use the 11 buttons firmware
- added temperature sensor support! connect a tmp36 sensor to pin A0
- added rumble and LED feedbacks when changing modes
- added various LED feedbacks
- added EEPROM save and load gun data
- updated the game screen ratio modes for better usage and compatibility, now there are only 2; fullscreen and 4:3. Obviously changing this option will have no effect if you have a 4:3 screen.
- updated the test tool, now the one pde tool supports both normal and full screen, and has more options (don't use the old tools)
Great JayBee, I will try it this weekend, in the meantime I have already ordered the sensors and the RGB LEDs ...: D is there any need for other additional components such as capacitors or resistors? I read that rgb pins should be put resistors, if so which ones? and for the TMP36 is a 0.1uf capacitor correct?
is the connection of the TMP is simply this: Pin1 + 5v Pin2 (central) pin arduino Pin3 gnd (and capacitor possibly)?
Are you sure the Arduino isn't on the same com port as another device anymore?Yes
If and only if it's on a unique com port, remove everything connected to the Arduino and try flashing an empty sketch with the Arduino IDE, after selecting the right com port.gives me an error in the compilation, collect.exe -1 while reading the card no problem
If it doesn't work, check what error it gives you.
If it's a problem resetting the arduino, use a wire on the reset pin to flash an empty sketch (you will find the process online).the same on another pc, i managed to install the new D-PAD 1.85 firmware by deleting the eprom data, in fact the cursor is now off-center again, but the pointing always stops after a few seconds, on the other hand I too can no longer do the calibration, if I keep the calibration button pressed, the cursor does not move to the center of the screen
Try on another computer too just in case.
If after all those tests it still doesn't work, it means your arduino is fried.I really hope the arduino is fried and not the cam ...: D today another pro micro should arrive, hopefully well, I better flash the firmware 1.75 or 1.85 to be sure of the operation?
Yeah it's most likely the Arduino.Are you sure the Arduino isn't on the same com port as another device anymore?YesIf and only if it's on a unique com port, remove everything connected to the Arduino and try flashing an empty sketch with the Arduino IDE, after selecting the right com port.gives me an error in the compilation, collect.exe -1 while reading the card no problem
If it doesn't work, check what error it gives you.If it's a problem resetting the arduino, use a wire on the reset pin to flash an empty sketch (you will find the process online).the same on another pc, i managed to install the new D-PAD 1.85 firmware by deleting the eprom data, in fact the cursor is now off-center again, but the pointing always stops after a few seconds, on the other hand I too can no longer do the calibration, if I keep the calibration button pressed, the cursor does not move to the center of the screen
Try on another computer too just in case.If after all those tests it still doesn't work, it means your arduino is fried.I really hope the arduino is fried and not the cam ...: D today another pro micro should arrive, hopefully well, I better flash the firmware 1.75 or 1.85 to be sure of the operation?
You could also review the 7-button version, because there are guns like mine that only have the trigger, 2 buttons and D-PAD, it would be more convenient to use the following buttons: TRIGGER, START, A BUTTON, D-PAD or at least in the my case :)With the dpad 4 direction this gun has 7 buttons (8 with the pedal). It will also need a 9th button for calibration.
Could the button associated with the Pedal still be used by connecting it to the A button or am I wrong?
Thanks so much :)
@kill_one just to be sure, the issue you had of the gun which stops working after a while, did it stop working when you use the test app?
If yes it's totally normal since the test app switches the firmware in test mode, and you have to replug the gun to switch back to normal.
With the dpad 4 direction this gun has 7 buttons (8 with the pedal). It will also need a 9th button for calibration.
So it's possible to support it with the led if you sacrifice one button for calibration, and the pedal (of if you connect the pedal and B on the same pin).
But it would require changing the pinout again, reason why I asked about it in the last poll :lol
now that I have found the gun problem, we come to another doubt that I have ... the connection of the TMP36 sensorYes exactly, +5V and GND of the arduino power the sensor
(http://killone.myqnapcloud.com/GUN/sensor.png)
connections:
PIN1 e PIN3 should they be connected to + 5v and gnd of the arduino or are those that feed the rumble also fine?
PIN2 to arduino A0 pin
thanks :)
HiYeah no problem, I could try to make that work ;)
Am wanting to make a wireless Bluetooth version of this with an ESP32.
I'm almost at the stage where I've got the same functionality as the SAMCO 2.0 working via Bluetooth LE keyboard and absolute mouse, along with classic BT serial that could be used for mamehooker and solenoid/rumble goodness.
Benefit of ESP32 is that there's plenty of processing power plus space for additional libraries like neopixel for RGB LED. Only downside to it is that is doesn't have USB HID support, however as it has BLE HID support, everything can be done wirelessly ;)
I see you're a bit hesitant with providing the code, but have said a few times you're happy to compile variations for other users.
Just wondering if I were to provide you the code with working composite BLE HID absolute position mouse (I hacked a library together based on absmouse library) / keyboard (and possibly gamepad - I made a working one already) and classic BT serial for makehooker all together in a working sketch, if you would consider adding your magic 4 LED code etc and compiling it for me to test out.
I do have a few of Pro Micros so can do it wired, but can't help thinking a wireless version would be fantastic too.
Thanks!Ok, I will look into it when I have a bit more time ;)
They're all basically the same, but this is the one i have on hand
https://www.aliexpress.com/item/32991132248.html
which is a clone of this
https://img.staticbg.com/images/oaupload/banggood/images/33/EE/51a8d415-7b17-4ae3-8274-b8317b03465f.jpg
but here is the generic pinout
https://randomnerdtutorials.com/esp32-pinout-reference-gpios/
So I’ve really got the itch to try and build this thing as I’ve been wanting a nice lightgun forever now. The problem is I’m very green at electronics and such and programming and feel like I would order everything put it all together, something wouldn’t work right and I’d be lost on how to troubleshoot. How easy for a novice like myself is this project in all honesty? Am I sweating myself up for failure? Should I wait till the project is more complete?No problem, we all started somewhere ;)
Also, is the Guncon2 recommended over the Guncon1? The 2 has more buttons and I would feel is more practical, but to me the 1 is that quintessential arcade gun form factor.
Lastly, if building I would start simple and just do the basic stuff first, if I got that working properly, can I add a solenoid later?
Long story short, should I wait for the Sinden that I know will be ready to go out of the box? Curious what the sunk cost difference would be, knowing I have to get like a solder gun and stuff for this project
Really enjoy reading your updates! Exciting to see how it progresses
For me, I do enjoy the tinkering aspect so I don’t mind doing some building of the gun, and the guns are relatively easy to find locally but if you had sold a kit of everything else somewhat assembled and the Arduino fully programmed and ready to go, that would something I’d be interested in. I’d feel much better know at least that aspect was ready to go and I wouldn’t have to troubleshoot that. I could then assemble it all in a gun and play around with the software in MAME, etc.Actually I was considering making some pcb for this setup, but realized that it wouldn't fit well with all the things I am putting in the guns, like solenoid, rumble... :lol
Just curious, I picked up a Guncon 1 at a local shop yesterday and he had a Guncon 3 for cheap so I picked it up too. Just curious if since the 3 was designed to work on lcd screens with a similar type of design, could the original camera be used with the Arduino? Would save me a few bucks!good question.
Let’s say it did in fact work, would it somehow be inferior to what you’re using? Superior? No difference? Would it be more work and more complicated for little or no benefit over the other one?There is no way we can answer to any of those questions without knowing the specs of the cam :lol
Would it be beneficial to take mine apart and take some pictures? Anything in particular I should look for?It probably won't help much, we need the datasheets of the components.
This seems to be the cheapest Pro Micro I can find in Canada including shipping. Can you confirm this should work?Yes it should :D
https://www.universal-solder.ca/product/arduino-pro-micro-atmega32u4-5v-sparkfun/
The rumble motor i'm using functions like a solenoid, when it rumbles it moves three gears which in turn pull the gun shell back to simulate the recoil.
Since i am only using rumble, then i should use the solenoid pin instead of the rumble pin, right?
Otherwise it won't work when shooting on screen?
I'd test this myself but i'm still waiting for the parts to arrive, so i'd like to make sure i'm doing this right.
Btw, the transistor isn't available at the moment, i can get the mosfet instead, do you think that would be an issue?
To be honest, i tried fitting everything but space was too tight and i kinda gave up on it, i might get back to it later on, though i'm probably gonna have to dremel the original pcb.The rumble motor i'm using functions like a solenoid, when it rumbles it moves three gears which in turn pull the gun shell back to simulate the recoil.
Since i am only using rumble, then i should use the solenoid pin instead of the rumble pin, right?
Otherwise it won't work when shooting on screen?
I'd test this myself but i'm still waiting for the parts to arrive, so i'd like to make sure i'm doing this right.
Btw, the transistor isn't available at the moment, i can get the mosfet instead, do you think that would be an issue?
Hey - is that the EMS Topgun II
I have 2 of them but when i opened it up everything looked so integrated and I wasn't sure I'd be able to mod it.
Could you let me know how you did it and perhaps post a few pics?
I have two aimtracks in namco point blank guns.Short answer: yes. and no :lol
Now I'm not 100 percent satisfied.
Will this be an update that is worth the huge effort of rebuilding everything?
I have two aimtracks in namco point blank guns.Short answer: yes. and no :lol
Now I'm not 100 percent satisfied.
Will this be an update that is worth the huge effort of rebuilding everything?
Long answer:
Yes, because I made this system for the exact same reason; I wasn't happy with other led systems. I though the IR led based gun techs we have now are overly expensive, under-exploited and lack several things that I addressed with my system. So in its current state my system is already the best non CRT lightgun system you can build. By far. And is always improving.
No, because this system is far from plug and play, it's totally DIY, and always evolving, so it requires lot of time and effort. There is this forum and a discord server tho if you need help with that ;)
Good answer. I'm a total diy guy and love building stuff. Just want to make sure that it will be an improvement.Yeah it def a huge improvement. The only thing missing now is a tool with a proper UI to configure the guns.
Have you thought of making a mode for the recoil that works like the one from aimtracks? That would make it possible to play games with recoil that do not Output via mamehooker.You mean triggering the solenoid once when using normal fire mode and autofire when holding? That's already the default mode, mamehooker is optional ;)
Good answer. I'm a total diy guy and love building stuff. Just want to make sure that it will be an improvement.Yeah it def a huge improvement. The only thing missing now is a tool with a proper UI to configure the guns.
But that will come too one day.Have you thought of making a mode for the recoil that works like the one from aimtracks? That would make it possible to play games with recoil that do not Output via mamehooker.You mean triggering the solenoid once when using normal fire mode and autofire when holding? That's already the default mode, mamehooker is optional ;)
Ah.I meant fullauto when holding trigger, not autofire.
No what I mean is one impulse when triggered. No autofire. Shooting of screen will not trigger.
Ah.I meant fullauto when holding trigger, not autofire.
No what I mean is one impulse when triggered. No autofire. Shooting of screen will not trigger.
But yeah it's already doing that, including the offscreen shoot that don't trigger the solenoid.
You don't need the controller remap utility nowadays, you can use ctrlr file to remap your guns and make them stable.Ah.I meant fullauto when holding trigger, not autofire.
No what I mean is one impulse when triggered. No autofire. Shooting of screen will not trigger.
But yeah it's already doing that, including the offscreen shoot that don't trigger the solenoid.
Ah, perfect. Everything sounds fantastic. I'm thinking of getting two more "namco" guns from ali express, let's see about the quality, but the "named" ones are sturdier than the originals.
What has been your experience with Mame and two guns? While I use the controler remap tool, my aimtracks can get lost sometimes and everything needs to be setup again. Super annoying.
You don't need the controller remap utility nowadays, you can use ctrlr file to remap your guns and make them stable.Ah.I meant fullauto when holding trigger, not autofire.
No what I mean is one impulse when triggered. No autofire. Shooting of screen will not trigger.
But yeah it's already doing that, including the offscreen shoot that don't trigger the solenoid.
Ah, perfect. Everything sounds fantastic. I'm thinking of getting two more "namco" guns from ali express, let's see about the quality, but the "named" ones are sturdier than the originals.
What has been your experience with Mame and two guns? While I use the controler remap tool, my aimtracks can get lost sometimes and everything needs to be setup again. Super annoying.
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
I did, but haven't found a way yet to use them in an efficient and harmless way.
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.
Did you keep looking into this? I'm in the market for IR Leds. That's why I'm asking.
During my tests, one of the led became so hot it melted a hole in my TV screen border :lol
My screen bravely suffered for the sake of science :laugh2:I did, but haven't found a way yet to use them in an efficient and harmless way.
Did you keep looking into this? I'm in the market for IR Leds. That's why I'm asking.
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:I did, but haven't found a way yet to use them in an efficient and harmless way.
Did you keep looking into this? I'm in the market for IR Leds. That's why I'm asking.
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.
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.
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
Hey Jaybee4mW/sr is way too weak
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
better ;)
These may be a better option:
https://www.digikey.ca/product-detail/en/osram-opto-semiconductors-inc/SFH-4546/475-2870-ND/2205956
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).
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.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)
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.
SQ Arcade. About 90 bucks for one. How's the quality of the shell? Did you find a good part for the microswitch?Not the same seller as mine, that's good!
If you could link me to any AliExpress ir LEDs that should work I'd be super thankful.
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 advanceYes, 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.
Thank you very much for this great work!! :applaud: :applaud: :applaud:Thanks ;)
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!
Thank you very much for this great work!! :applaud: :applaud: :applaud:Thanks ;)
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!
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!Yeah this calculation is very old, unoptimized and doesn't work well, even for the 2 points calculation.
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!! ;) ;)
Another video I just made in pov to show the pinpoint accuracy of this system:I commend you sir on a properly done lightgun accuracy demonstration.
https://youtu.be/u64Fsu6oNQk
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.Thanks ;D
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 ownThanks a lot Ryoken, I'm very happy to hear that :cheers:
Hello, i'm gonna buy these IR LEDSLooks like that datasheet has some conflicting info on pg 3. :dizzy:
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
If i would like to buy these https://pdf1.alldatasheet.com/datasheet-pdf/view/89554/KINGBRIGHT/L-53F3C.htmlThat datasheet covers eight different LEDs with different ratings. :dunno
Is it correct entering the following ?Looking at the L-53F3C datasheet at https://datasheet.octopart.com/L-53F3C-Kingbright-datasheet-13425907.pdf (https://datasheet.octopart.com/L-53F3C-Kingbright-datasheet-13425907.pdf)
Source voltage 5
diode forward voltage 1.5
diode forward current (mA) 50
number of LEDs in your array 8
So for this model https://pdf1.alldatasheet.com/datasheet-pdf/view/89554/KINGBRIGHT/L-53F3C.html according to the specs and your suggestions i will put these dataOnce again, that datasheet is for a series of eight different LEDs with four different sets of specs. :banghead:
diode forward voltage 1.5Look at the four "Forward Current vs. Forward Voltage" charts on pages 3-5.
diode forward current (mA) 20
Are they powerful enough for 1/1.5 meter distance ?I'll let JayBee answer this question since he has hands-on experience designing/building these and should be able to compare the datasheet for his LEDs to the datasheet for your LEDs once you clarify exactly which LED P/N you are asking about.
I'll let JayBee answer this question since he has hands-on experience designing/building these and should be able to compare the datasheet for his LEDs to the datasheet for your LEDs once you clarify exactly which LED P/N you are asking about.Thanks for helping bro ;D
The link of L-53F3C was right...but the site has a kind of protectionYour link is still not working.
https://pdf1.alldatasheet.com/datasheet-pdf/view/89554/KINGBRIGHT/L-53F3C/+5JW55UhGLGwyKIlZfSHEDP.O+/datasheet.pdf
PART number is L-53F3C , according to your suggestions and datasheet
Source voltage 5
diode forward voltage 1.26
diode forward current (mA) 40
number of LEDs in your array 8
PART number is L-53F3C , according to your suggestions and datasheet
Source voltage 5
diode forward voltage 1.26
diode forward current (mA) 40
number of LEDs in your array 8
Just recently built a control box even though it's missing punch of other stuff too like trackball and spinners, I personally mostly yearn for a pair of guns. As there's not many options on the market for a calibration free systems, I started experimenting with a regular RGB camera and OpenCV with screen edge detection. Quick tests are somewhat promising but might have too much lag in the end so to get something a usable sooner, I ordered the HW for pair of Arduino IR guns.Yeah that's the main problem of using a normal cam for this task, it takes lot of power and have quite a lot of latency, especially if the cam doesn't have high frame rate.
@JayBee I'm more than happy to support you but still would of course want to receive the licence too and reading the red text in the first post, not that sure if I will as a fresh forum member?
Yeah it's essentially the wiimote camera right? So it's purpose built for this.Yes pretty much. Still searching for a better alternative, but haven't found one yet.
The biggest update lately is adding the sensitivity levels that you can now change! so you can fit the camera to your setup way more easily.
As the name imply, they are just different level of sensitivity for the IR camera. The lower the sensitivity is, the less you will get light parasites, but the more difficult it will be to pick up led points if you are far or they aren't strong enough.
The biggest update lately is adding the sensitivity levels that you can now change! so you can fit the camera to your setup way more easily.
Thanks a lot for this. May I ask what the different sensitivity settings do and which criteria should be used to prefer one or the other?
I'm going to mount this light gun, does this solenoid need a temperature sensor or is it optional?The sensor is always optional, but it's useful if you're not sure how hot the solenoid gets while working ;)
Hello Friend. I am not able to make it work, the mame hooker does not recognize the arduino, I put the output in mame.ini (windows). I configured mame.exe on mamehooker ...That's normal.
Amigo, fiz o processo para adquirir seus arquivos. Poderia conferir?I already sent it to you earlier ;)
avrdude -C avrdude.conf -v -patmega32u4 -cavr109 -PCOM12 -b57600 -D -Uflash:w:"JayBee_IRLightGun_4Points_2.26.ino.jbgunpm1.hex":i
Hi,What's the board name you're choosing when flashing in the arduino IDE? The arduino model detected is completely dependent of the model you choose in the list ;)
I did of course read the first post but what I mean is that the GUI flasher doesn't recognize the board (empty sketch was in so no, it wasn't in the fresh bootloader state) and thus doesn't allow flashing it. I have 64 bit OS and like said, avrdude otherwise works ok. This particular board also functions perfectly in Arduino IDE and obeys the reset command IDE sends during flashing etc. so no problem there either. Win 10 so no additional drivers required either. Just thought to mention this another / normal flashing route as I didn't see it mentioned anywhere.
I have some 1W leds on their way and I actually just spotted your one post about similar powered ones. I thought they'd still be too weak with the wide angle, based on current tests so that's why I asked if anyone has tested 3-10W ones but you seemed to have good results with those so maybe they're powerful enough. And yeah, they need some cooling to prevent melting / igniting things around :)
Test screen & cal screens work ok, but they don't give any info about seen LEDs.
Camera test tab does absolutely nothing. I guess there should be some dots shown and button status should be indicated on right side panel but nothing is happening on my screen and yes, I did press 'start testing' :).
Did you use fish eye sort of lens or a more subtle, less distorting wide lens? I have some china quality 0.67x lenses on their way (well some 3-in-1 packs where there is fish eye lens too).
What's the board name you're choosing when flashing in the arduino IDE? The arduino model detected is completely dependent of the model you choose in the list ;)
Fresh bootloader or not doesn't matter, despite what I first thought the issue isn't related to the bootloader, but to the model you choose in arduino IDE.
The difference between my app and the arduino IDE is that arduino IDE doesn't do automatic detection, so that you can select any serial arduino. My app does autodetection and therefore is limited to only the correct PID/VID, to avoid any flash on incompatible boards. The sparkfun board doesn't have the correct IDs by default. I might fix that in future app updates.
If the board is recognized but you still have issues flashing, try changing the avrdude and app properties to run them as admin, or putting them in a more short path folder.
There is no reason that shouldn't work, since the all my app does is running an avrdude command exactly as you do manually :lol
BN: Unknown board
VID: 1B4F
PID: 9206
SN: Upload any sketch to obtain it
As the GUI isn't detecting the board I can't yet confirm if there'd be any issue with the avrdude itself, but at this point it's most likely just the VID/PID thing.That's the first time I hear that the cam test does nothing. Even the buttons testing isn't showing anything when pushed?
If not, it means there is a serial communication issue between the gun and pc. If the buttons react, it means either the cam has an issue or the connection between the cam and the board is bad.
The calibration screen should also start the gun calibration, is that what's happening?
Have you tried unplug/replug the gun, restart the app, and then go directly to the cam tab without touching anything else?
Fish eyes lens has too much deformation, it messes up too much with the calibration. Wide lenses are the way to go.I thought so. I just noticed the 'fish eye' term in some post and wondered if it really didn't affect too much the accuracy. What zoom factor did your lens have?
Used Sparkfun Pro Micro / ATMega32U4 (5V, 16Mhz) during uploading the empty sketch. Board info shows:Yeah that's exactly what I said in my previous message, you need to flash it as arduino Leonardo model, or else it won't work :lolCode: [Select]BN: Unknown board
As the GUI isn't detecting the board I can't yet confirm if there'd be any issue with the avrdude itself, but at this point it's most likely just the VID/PID thing.
[b]VID: 1B4F
PID: 9206[/b]
SN: Upload any sketch to obtain it
Everything else works like should. I can calibrate it normally and it functions normally, just the cam test tab is dead. Even button press indications react in no way and they too work in reality (or well, at least trigger does as I'm still running this on a breadboard so only 1 or 2 micro switches connected during testing). I tested the GUI on two different PCs and have replugged the chip several times and also flashed it few times.Seems like a serial communication issue or something similar.
I thought so. I just noticed the 'fish eye' term in some post and wondered if it really didn't affect too much the accuracy. What zoom factor did your lens have?Mine has is 0.6x, but other users successfully tested lenses from 0.36x (cheap Chinese ones).
Final piece of the puzzle landed on my desk today, the IR sensor! Can't wait to get home and put everything together.Thanks a lot! :cheers:
I've got a couple of old CCTV cameras that have ~30 IR LED's on each of them, going to recycle a few and see how they behave. I assume they should give a good result as the cameras had reasonable range and angle at night. I'll test them in the GUI app to get a better idea.
JayBee I've just sent donation via PayPal for the GUI, Thanks! :cheers:
Thanks a lot! :cheers:
I sent the license to you email address ;D
Yeah in my experience CCTV leds can give good result. Are they smd or normal leds?
You're using the DFRobot cam for your guns, right?
hello friend, sorry for my ignorance but i was wondering if you can help me finish the project, i set up the leds, and the arduino inside the pistol, but i don't know how to make it work, i want to use the retroarch and i'm watching a samco tutorial, just that when I'm going to configure the buttons on the retroach the pistol does not work, I opened the serial monitor and it is working ok, I saw that you speak of avrdude, you speak of flashing the empty sketch in the arduino's ide to work, can you help me? Thank you very much in advance.In order to help you, I will need more information;
estou usando arduino pro micro Atmega32u4 5v/16hz.Games won't work with a test firmware, it's just for testing. You have to flash the full firmware to play.
windows 10 64bits
pinos usados.
SDA = pino 2
SCL = pino 3
trigger = pino A2
botão A = pino A3
botao B = pino 4
pedal = pino 6
calibraçao = pino A1
como faço, onde posso encontrar o firmware atualizado?Can you please speak english? I don't understand Italian.
where do I download the updated sketch? the only file I found was (IR_Light_Gun-2.16). it's that? can you explain how do i upload the updated sketch?Like I said, everything is in the first post, including the firmware and gui download.
the donor license I already have.then I don't understand what you are asking, flashing the firmware is as simple as select your board and pushing a button in my GUI.
my doubt is how to load the .hex files on the arduino.Tools => Flash Firmware...
The firmware 1, 2, 3 & 4 are for the player 1, 2, 3 & 4, the ones you select on the bottom part.
I managed to load the firmware with xloader. I have some doubts, I loaded the first .hex file (JayBee_IRLightGun_4Points_2.26.ino.jbgunmi1) the other .hex files, 2, 3 ... load automatically? the arduino was recognized by the GUI, what do I need to do for the buttons and camera to work, because I can only move through the pc keyboard.
nothing happens, the buttons don't work either.That grey dot in the middle shows that the communication with the board is working. But the camera can't see anything or isn't connected correctly.
now i will try to use it in the retroarch I appreciate all the patience and help. thank you very much!No problem, glad you got it worked ;)
anyone here already managed to use in retroarch? I made the configuration like samco, but the gun only moves the mouse, the buttons do not work and a message appears saying that the pistol is not configured, only that everything is configured.In retroarch it's per core related config. Some support the gun, some don't (it's even version/game dependent).
do you use mame, what lightgun games can you run on mame and what are they?Ok it looks like a moderator removed the link I sent, even if it doesn't contain any rom of any sort.
hello, i decided to use mame, i went to mame .ini i modified #Sorry that's not a gun issue but a mame issue, I'm not a specialist with it, you'd have to ask in the mame forum for help I'm afraid :-\
# OSD OUTPUT OPTIONS
#
output windows
# CORE INPUT OPTIONS
#
mouse 1
but when I run the game I can't move or shoot with the gun, I configure the buttons within the game, even so I can't, is there any other modification for the game to recognize the gun? out of the game I can move the arrow and use the buttons on the gun.
how do you send commands via serial with your GUI?You don't. You use mamehooker like written in my guide.
You need to turn lightgun to 1, not mouse.
Look here: https://youtu.be/mcnBxqiJzD8
It's aimed at aimtrak users, but the procedure is the same for all guns basically.
Hi, i was wondering if someone could build me a gun with this module, i am in the uk and wanted this gun converted:Actually I'm planning to build some premade guns in the future for people who want it, but it's not for the near future tho, it might take a while.
https://www.aliexpress.com/item/4000682192646.html?spm=a2g0o.productlist.0.0.64c37cb1EcSpUi&algo_pvid=e254f106-8ea7-46fc-81fb-d5bf662c13fd&algo_expid=e254f106-8ea7-46fc-81fb-d5bf662c13fd-0&btsid=2100bde116036577551161651e0004&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_ (https://www.aliexpress.com/item/4000682192646.html?spm=a2g0o.productlist.0.0.64c37cb1EcSpUi&algo_pvid=e254f106-8ea7-46fc-81fb-d5bf662c13fd&algo_expid=e254f106-8ea7-46fc-81fb-d5bf662c13fd-0&btsid=2100bde116036577551161651e0004&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_)
I've ordered some of these LED's, they're cheap and look reasonable in the photos, but who really knows from china :lol In the customer reviews it looks like you can remove the lens to reveal the SMD LED, but who knows the lens might actually help.
https://www.aliexpress.com/item/32962722947.html?spm=a2g0s.9042311.0.0.3a064c4digQvLZ
Nice! That makes another good alternative option for the led system ;DI've ordered some of these LED's, they're cheap and look reasonable in the photos, but who really knows from china :lol In the customer reviews it looks like you can remove the lens to reveal the SMD LED, but who knows the lens might actually help.
https://www.aliexpress.com/item/32962722947.html?spm=a2g0s.9042311.0.0.3a064c4digQvLZ
LED's finally arrived and has completely fixed tracking/jitter issues I had with the gun, played for 1hr straight without a single issue! Excellent option for $8
The only downside is they generate a lot of heat, too hot to touch. Will need to make up a clip to hold them away from the TV frame as i'm pretty sure it could melt.
So I've been looking into building one of these, I have the Namco Guncoms to hack, but I was wondering about parts, the 1st post mentions hacking the camera from a WiiMote, but I see no instructions to do this, does anyone have any? Can I use the leds from a Wii bar? and lastly is this controller ok to use? https://www.ebay.co.uk/itm/Arduino-Pro-Micro-Leonardo-compatible-5V-16MHz-ATmega32U4-headers-UK-TESTED-/251960157859Yes, you can hack the wilmote cam but it's a bit involved process, especially to adjust the cam in the gun's barrel once the circuit is done.
I think that will give me the basics to build one of these, budgets a bit tight atm is all, thanks.
I think that will give me the basics to build one of these, budgets a bit tight atm is all, thanks.Yes, you can hack the wilmote cam but it's a bit involved process, especially to adjust the cam in the gun's barrel once the circuit is done.
Yeah, if it uses batteries, unless it uses 4 or more AA batteries, you can easily recreate the current/voltage needed with a resistors voltage divider ;)
I might just order the right camera then, I found it for a good price on Amazon, as for the LEDs it's a wireless bar so just takes X amount of batteries, which I suspect I can run from a USB port for equvailent power.
Alright, finally got it going.that's great, I'm glad to hear the system is working well for you :D
This is so much fun!!! JB great job!!!! :applaud:
I'll be giving a full review of the problems I've faced and how I resolved them probs in a couple weeks or so, we'll see.
I wasn't able to get the WII cam to work. I'm guessing because of the clock. I harvested some oscillators from some old boards, but I hardly know what I'm doing, software or hardware wise. The DFRobot cam worked right out of the box.
This system is ideal for me because I can make any gun into a light gun. I plan on making this one and a few more with rumble and the slide kickback.
Great work JB and everyone involved!! :cheers:
btw the verification steps to reply seem like a little much.
Hello, first of all congratulations for this great project, I wanted to make a question: I am from South America and here it is very difficult to get parts like the DFRobot IR Camera, so I was thinking of making the gun with a wiimote camera, but I am not very clear as would be the diagram with the 5v-3.3v converter and other diodes, crystals, etc. Could you help me with that diagram? thank youYes I will provide a complete schematics as soon as I test it better ;)
Yes I will provide a complete schematics as soon as I test it better ;)
Ho guys how can i set/mount the temperature sensor near the solenoid?I usually put it against the coil, between the coil and the metal frame, which is ideal to sense the heat from the coil. I hold it in place with simple electrical tape.
Inviato dal mio Redmi Note 8T utilizzando Tapatalk
Can you post a photo of this?Ho guys how can i set/mount the temperature sensor near the solenoid?I usually put it against the coil, between the coil and the metal frame, which is ideal to sense the heat from the coil. I hold it in place with simple electrical tape.
Inviato dal mio Redmi Note 8T utilizzando Tapatalk
Be careful tho to not make any contact between the sensor pins and the metal part.
This is just too dang cool! I just read all 17 pages, LOL.You're welcome ;)
Thank you JeyBee and all others out there figuring all this out!
I'm in! I recently working on a project to basically house a WiiMote in to a Nintendo Zapper body and just never really got it working very well.
Now I see this, its within my skillset (I hope, LOL) and almost custom tailored for what I want to do. WheeeeeEeeeeEe! Plus the add on options... recoil etc... I'll have to think on what I want, LOL.
Questions.... I have so many, but a couple of key ones...
I saw mention of, but not many details on using a WiiMote camera. Other than cost, does this have any advantages in sensing ability? I'm curious about the LED Brightness issues, and why it seems to be an issue when the WiiMote/DolphinBar setup doesn't seem to be doing anything special with the LED's? Is it less of a problem with official WiiMote gear?
I almost wonder if its a light wavelength issues? Has anyone noted a difference between 850 vs 940 nm and how well they read?
For now... off to donate and source some pieces-parts.
Thank you to all involved this project, its freaking awesome.
Hi to everybody!This model won't work, you need very specific specs.
I am looking to build my own gun (my first one, just to give it a try) and would like to find a link for buying a compatible IR camera here in Europe, or in AliExpress. Could you tell me if this model feets the specifications?
https://a.aliexpress.com/_B0ZRsz
Thank you in advance!
Cannot find the Discord server of the project (I am quite noob with Discord). @JayBee can you share a direct link? Thank you in advance.https://discord.com/invite/HJyfYja
https://discord.com/invite/HJyfYja
First of all, hello to everybody.There are 2 modes that you can easily switch between with the gun, the first is of course mice, which is supported by many emulators and games with raw mouse input (sometime through the Demulshooter app), and the second mode is joystick, which is basically using a controller X and Y axis and buttons instead of the mouse and keyboard ;D
I'd like to thank all of the passionate people here trying to revive all those childhood memories.
I'm about to drop a few bucks, but I'd like to know if the games are two player compatible.
I'm seeing that it emulates a mouse, but connecting two mice doesn't allow me to play.
How this can be solved?
Thank you again for this impressive work.
Cheers.
First of all, hello to everybody.There are 2 modes that you can easily switch between with the gun, the first is of course mice, which is supported by many emulators and games with raw mouse input (sometime through the Demulshooter app), and the second mode is joystick, which is basically using a controller X and Y axis and buttons instead of the mouse and keyboard ;D
I'd like to thank all of the passionate people here trying to revive all those childhood memories.
I'm about to drop a few bucks, but I'd like to know if the games are two player compatible.
I'm seeing that it emulates a mouse, but connecting two mice doesn't allow me to play.
How this can be solved?
Thank you again for this impressive work.
Cheers.
Yes I did a gcon2 mod, it's not super easy to mod, but not the worse either. I even managed to fit all feedbacks in it, like a mini solenoid, rumble motor and rgb led for notifications :lol
Thank you for the info.
I'm reading about RawInput and Demulshooter.
I guess I'll order a DFRobot camera soon.
Cheers!
EDIT: Have anybody tried to cram the Gun4IR inside a Gun-con 2 controller? (NPC-106).
I'm considering purchasing this instead the original GunCon because the D-Pad, which brings another question
Is the D-Pad really that needed for lightgun games?
Is there any list which contains mandatory D-Pad for lightgun games? That way I can avoid making the nunchuck mod.
Thank you.
Thanks for your reply.Yes I did a gcon2 mod, it's not super easy to mod, but not the worse either. I even managed to fit all feedbacks in it, like a mini solenoid, rumble motor and rgb led for notifications :lol
Thank you for the info.
I'm reading about RawInput and Demulshooter.
I guess I'll order a DFRobot camera soon.
Cheers!
EDIT: Have anybody tried to cram the Gun4IR inside a Gun-con 2 controller? (NPC-106).
I'm considering purchasing this instead the original GunCon because the D-Pad, which brings another question
Is the D-Pad really that needed for lightgun games?
Is there any list which contains mandatory D-Pad for lightgun games? That way I can avoid making the nunchuck mod.
Thank you.
You can find more info on it in my discord server if you want (the link in the first post).
To be honest a dpad on a gun is quite useless for in-game stuff, and is required only on some rare ps2 games, and maybe wii games but those aren't really lightgun games.
I mostly use my dpad to scroll in menus from my sofa without having to go back to my pc.