Main > Lightguns |
SAMCO DIY Arduino Powered IR Light Gun |
<< < (28/37) > >> |
samco:
Nice one Prow! Thanks for the heads up on the AbsMouse Library too. I don't have too much time to tinker at the moment so I'll be keeping an eye on this thread to see how this goes and what you guys think of the RP2040. |
ThatOneSeong:
So I will say the process of getting here was a bit of an experience for me... First off, without even having gun in hand, following the procedures in advance setting the board up had me for a loop.Firstly, even getting an RP2040 recognized in Arduino software--which Adafruit's store page and documentation contradict one-another atm (one says there is no support, another generic Raspberry Pico page was updated saying there is...)--was difficult since it's a third-party repository that needed a bit of searching to find. Would be nice to add this in the SamcoEnhanced readme for 2040-ers.Sidenote, this might just be my PC, but the board wasn't being assigned a serial driver like it's supposed to, but was stubbornly hanging as an unknown device with no known drivers. I had to force the 'RP2 USB' device to use a Microsoft-brand USB Serial Device. But at least afterwards, I can assign the port number and it was able to be flashed just fine. One thing that was unclear as a first-timer was the note in the Enhanced repo; --- Quote ---If you are using an ItsyBitsy M0 or M4 then I recommend you set the Optimize option to -O3 (or faster). If you are using an ItsyBitsy RP2040 then I recommend the -O3 Optimize option. --- End quote --- I was looking and couldn't find any such Optimize flag options; neither in the Preferences, or the Sketch/Tools dropdowns that Ada's documentation suggested should be there. Nada.And results when searching for "Arduino optimization flags" kept bringing up coding habits, but not the GCC flags. There was only one I could find after going through multiple pages that pointed to C:\Program Files (x86)\Arduino\hardware\arduino\avr\platform.txt where I could change the references of -Os to -O3. If there is something I'm overlooking here, feel free to say, but maybe a note should be appended on what exactly this step means on the latest Arduino IDE. Anyways, from there, code runs, that's all I could get at the time. Fast forward to today and my GCon 2 arrives. Time to get to work.Disassembly and all that wasn't hard at all, thanks to Samco's own video documentation on the process. This was my first substantial soldering work in quite some time, so I was proud to see good joints coming out of it.My main difficulty came when I was adding in a microswitch mod where I had to rip out the original trigger tact switch (what a frick that was), and plant in a microswitch alongside a replacement arm attached to the trigger. While that worked out, it made cable routing feel kind of precarious - of which I also had a bit of trouble, since I tried attaching my microUSB to the board after attaching the B button board, which wouldn't work. I had to take out the button standoff and put the cable in before reattaching, but it felt quite tight. Thankfully, it all ended up coming together in the end. Prow is all too right about the GPIO mapping. But I figured it out with just a bit of cross-referencing Samco's documents; --- Code: ---Trigger = 6 D-Up = 9 D-Left = 8 D-Down = 7 D-Right = 10 C = 11 A/B/Start/Select/Pedal stays the same. --- End code --- While I'm unfortunately still not able to use the gun due to the camera still being backordered, I can at least confirm all the inputs work (after changing the sketch mappings) as well as the calibration toggle. It will unfortunately be another lengthy wait I imagine before this is really finished, but the process so far has been fun and leaving me with great anticipation for what it's like when it's really working. A lot of rambling for a lot of nothing seems to be my only contributions here, but I'm kind of okay with that. (^^; |
ThatOneSeong:
Self-bumping update: I got the camera, and aside from the TOP label being off by 90 degrees clockwise, it all seems to be working. I'm glad I got one more sensor bar than I needed because the sole one I've had on my monitor for a few years for my Wiimote has such a narrow FOV compared to the new ones I'd just ordered, it's crazy. I did manage to play through Time Crisis on MAME without any issue, it tracks surprisingly really well and no latency--especially when coming from a wireless EMS. But after I decided to play T2 Arcade, a few minutes in, the trigger started acting a bit funny and some of the depressed shots were only firing off for a frame or something. It didn't seem to be consistent, but weird how it crops up so late into it. From what I can tell, I think on some inputs, it's double-clicking instead of firing once and holding like I want it to? Because it's not just the trigger - the start button also on rare occasions can spurt out 1111 which was odd (esp. since it's one of the buttons directly embedded to the Samco2 board). I was going to say it worked better some time later, but when playing a Naomi shooter through the Flycast core on RetroArch, again halfway through, all my on-screen shots just... stop registering? And when I alt-tabbed, this very messagebox I'm typing this in was being spammed with 1111's. It's stuff like that which makes it hard for me to believe it's just the trigger microswitch that's bad... it's literally brand new and I even triple-checked my solder points; no joints touching one-another or anything. After writing this part I played Point Blank with lr-Duckstation with no issues, just like with Time Crisis (though I did note two small instances of double-clicking). Maybe it's just brandist against anything non-Namco. @Prow, any idea what's up here? EDIT:L Update to the update. Of course, the next morning I try to confirm the trigger issue and it's working perfectly again. But the D-pad (and kinda start button) is still sticky sometimes. But I've noticed on two separate instances that after some time (pretty much *only* happens after putting the gun down for a bit then up again), the calibrated aim is offset a quarter-screen to the right, despite not having moved at all since. But it's fixed with a re-calibration, so... I don't have a clue really. |
Prow:
--- Quote from: ThatOneSeong on October 11, 2021, 07:46:50 pm --- From what I can tell, I think on some inputs, it's double-clicking instead of firing once and holding like I want it to? Because it's not just the trigger - the start button also on rare occasions can spurt out 1111 which was odd (esp. since it's one of the buttons directly embedded to the Samco2 board). I was going to say it worked better some time later, but when playing a Naomi shooter through the Flycast core on RetroArch, again halfway through, all my on-screen shots just... stop registering? And when I alt-tabbed, this very messagebox I'm typing this in was being spammed with 1111's. --- End quote --- Adjusting the debounce time will hopefully fix this. I'm not sure why I set the debounce times lower than they need to be. I'll make a note to fix the sketch. With that said, I don't have any issue with my gun and the buttons. --- Quote ---But I've noticed on two separate instances that after some time (pretty much *only* happens after putting the gun down for a bit then up again), the calibrated aim is offset a quarter-screen to the right, despite not having moved at all since. But it's fixed with a re-calibration, so... I don't have a clue really. --- End quote --- Interesting you report this as I had this happen once recently. In my case, I reconnected the USB cable and it was fine since I have the calibration stored in NVRAM. Just as you say, I recall I set the gun down for a bit and then when I picked it up the aim was way off. If you can reproduce this it would be interesting to know if the calibration values somehow change. You can view them in the serial monitor (or any serial terminal program). I was unable to reproduce it, but only tried a few times. --- Quote ---I was looking and couldn't find any such Optimize flag options; neither in the Preferences, or the Sketch/Tools dropdowns --- End quote --- I jumped the gun on this one... I submitted a Pull Request to the Arduino Pico project and expected an update to be released before anyone would actually use an RP2040 build. It actually may not matter all that much, but might as well optimize for speed. I'll update the wording to describe it as an optional setting if it's available. |
ThatOneSeong:
Heeey, sorry for the wait. Been pulled away for some time on some PC upgrades and switching to Linux. Fun. --- Quote from: Prow on October 13, 2021, 01:08:52 am ---Interesting you report this as I had this happen once recently. In my case, I reconnected the USB cable and it was fine since I have the calibration stored in NVRAM. Just as you say, I recall I set the gun down for a bit and then when I picked it up the aim was way off. If you can reproduce this it would be interesting to know if the calibration values somehow change. You can view them in the serial monitor (or any serial terminal program). I was unable to reproduce it, but only tried a few times. --- End quote --- Seems like we've both only had this happen once without any way to reproduce. But this hasn't happened often. And I appreciate the honesty - easily forgiven, though no less confusing for a first-timer. I think it's safe to say the debounce--or lack thereof--only affects my membrane buttons, but definitely not an issue with the trigger (the unresponsiveness might've just needed some time to get worn in. shrug). As of now, I'm just trying to work out how to get this working in X11. Not the most straightforward thing to say the least. :laugh: |
Navigation |
Message Index |
Next page |
Previous page |