@bombers821 it is illegal to sell retropie especially with roms already included. 3rd party images are not supported here. If you would like support here you will need to download the official supported image (https://retropie.org.uk/download/). If you want support for you're current image you'll need to ask the person who sold it to you for help.
I did have a similar problem to you (but not the same) with zero delay arcade joysticks. I fixed it. Try this first. The 5 pin connector may be attached the wrong way around. I bought 4 or 5 similar joysticks about 3 years ago. The connector (ie the connector to the joystick) connects both ways but only one way is right. When I connected mine upside down, it would read only a couple of the directions until I turned it the other way around. I found back then there was no way of telling which way was right and which wrong - at least when connected to the Pi.
Pi Model or other hardware: (B, B+, 2 B, 3, X86 PC etc..)
Power Supply used: (If using a Pi)
RetroPie Version Used (eg 3.6, 3.8.1, 4.1 - do not write latest):
Built From: (Pre made SD Image on RetroPie website, Berryboot, or on top of existing OS etc.. - please provide the filename of any image used)
USB Devices connected:
Error messages received:
Log found in /dev/shm/runcommand.log (if relevant):
Guide used: (Mention if you followed a guide)
File: (File with issue - with FULL path)
Emulator: (Name of emulator - if applicable)
Attachment of config files: (PLEASE USE PASTEBIN.COM FOR LARGE LOGS)
How to replicate the problem:
Please copy the above and fill in the info. Otherwise we have no idea how to start helping you.
@cjohnson26 the Pie will boot and the function of these few lines are just to ask status for a sensor after the has booted.
But for your idea to work as on off switch for booting up a device this also works but you do not need a code or something. Just connect the hall effect sensor like a switch on a power device like the Mausberry or a Pimoroni on off SHIM and it will act like a button press. For switching of you need to ask status then you can use that code.