Main > Lightguns
SAMCO DIY Arduino Powered IR Light Gun
<< < (32/37) > >>
DemmyTree:
Sorry to bother you, im having issues with the setup of the lightgun, i've bound everything to the PCB and have been trying to upload the code but it is coming up with failures no matter what im attempting.

It seems the problem that comes up is mainly to do with the HID and USB Endpoint, im not sure what that means and need assistance if anyone is able to explain this.
samco:

--- Quote from: DemmyTree on November 29, 2022, 03:28:53 pm ---Sorry to bother you, im having issues with the setup of the lightgun, i've bound everything to the PCB and have been trying to upload the code but it is coming up with failures no matter what im attempting.

It seems the problem that comes up is mainly to do with the HID and USB Endpoint, im not sure what that means and need assistance if anyone is able to explain this.


--- End quote ---

Hi Mate, any chance you can chuck up a screenshot of the IDE (including errors). Might be able to give ya hand.
DemmyTree:

--- Quote from: samco on December 01, 2022, 07:54:47 pm ---
--- Quote from: DemmyTree on November 29, 2022, 03:28:53 pm ---Sorry to bother you, im having issues with the setup of the lightgun, i've bound everything to the PCB and have been trying to upload the code but it is coming up with failures no matter what im attempting.

It seems the problem that comes up is mainly to do with the HID and USB Endpoint, im not sure what that means and need assistance if anyone is able to explain this.


--- End quote ---

Hi Mate, any chance you can chuck up a screenshot of the IDE (including errors). Might be able to give ya hand.

--- End quote ---
I've never touched Arduino before and just used the stock sketch you created for it. Im using the ItsyBitsy M0 Express but have also attempted it on a M4 Express as well.

The version is 1.8.15 on Samco_1.1_4IR_BETA.ino (i have tried the 2IR version and also had the same failure occurrence) The board is not soldered onto the PCB however it is held in by headers with an additional header to keep it in place

On the serial monitor it picks up the camera partially keeps repeating with no movement of the cursor occuring when shifting the gun around.
15:47:58.811 -> CALIBRATION:     Cam Center x/y: 512, 450     Offsets x/y: 1.47, 0.82
15:47:58.861 -> Device not available!


In file included from C:\Users\DemmyTree\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.11\cores\arduino/Arduino.h:157,
                 from C:\Users\DemmyTree\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.11\cores\arduino/USB/SAMD21_USBDevice.h:22,
                 from C:\Users\DemmyTree\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.11\cores\arduino/USB/USBAPI.h:37,
                 from C:\Users\DemmyTree\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.11\cores\arduino/USB/PluggableUSB.h:23,
                 from C:\Users\DemmyTree\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.11\libraries\HID\HID.cpp:19:
C:\Users\DemmyTree\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.11\libraries\HID\HID.cpp: In member function 'virtual int HID_::getInterface(uint8_t*)':
C:\Users\DemmyTree\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.11\cores\arduino/USB/USBCore.h:37:56: warning: narrowing conversion of '(int)(((unsigned char)((int)((HID_*)this)->HID_::<anonymous>.PluggableUSBModule::pluggedEndpoint)) | 128)' from 'int' to 'uint8_t' {aka 'unsigned char'} [-Wnarrowing]
   37 | #define USB_ENDPOINT_IN(addr)                  ((addr) | 0x80)
      |                                                ~~~~~~~~^~~~~~~
C:\Users\DemmyTree\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.11\cores\arduino/USB/USBCore.h:276:10: note: in definition of macro 'D_ENDPOINT'
  276 |  { 7, 5, _addr,_attr,_packetSize, _interval }
      |          ^~~~~
C:\Users\DemmyTree\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.11\libraries\HID\HID.cpp:36:14: note: in expansion of macro 'USB_ENDPOINT_IN'
   36 |   D_ENDPOINT(USB_ENDPOINT_IN(pluggedEndpoint), USB_ENDPOINT_TYPE_INTERRUPT, 0x40, 0x01)
      |              ^~~~~~~~~~~~~~~
Sketch uses 48236 bytes (18%) of program storage space. Maximum is 262144 bytes.
Device       : ATSAMD21x18
Version      : v1.1 [Arduino:XYZ] Jun 23 2019 17:45:14
Address      : 0x0
Pages        : 4096
Page Size    : 64 bytes
Total Size   : 256KB
Planes       : 1
Lock Regions : 16
Locked       : none
Security     : false
BOD          : true
BOR          : true
Write 48556 bytes to flash (759 pages)
[==============================] 100% (759/759 pages)
Done in 9.417 seconds
Verify 48556 bytes of flash
[==============================] 100% (759/759 pages)
Verify successful
Done in 3.808 seconds
samco:
Hi @DemmyTree, it looks like a connection problem. "Device not available!" basically mean the ItsyBitsy cannot connect to the camera so you could double check you've got all the wires round the right way and try again. But I think it's probably more likely you just not getting a good connection because nothing is soldered in.
scratcher53:
Hi Sam,

I have built two of your guns and use them with demulshooter and various emulators in bigbox / launchbox. The problem i have is people keep hitting the calibration button by mistake. The question is can i change the calibration button to one of the d pad buttons and then have the original calibration button as the reload button. I have looked at the code but it all went over my head.
Thanks for the help
Navigation
Message Index
Next page
Previous page

Go to full version